JSPM

@umdjs/query-string

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q33150F
  • License MIT

UMD build dist for query-string.

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@umdjs/query-string) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    @umdjs/query-string

    UMD build dist for query-string.

    English ・ 简体中文Changelog · Report Bug · Request Feature

    codecov

    📦 Usage

    [!NOTE]
    The @umdjs/query-string only provides UMD dist of query-string.

    Add script tag in your browser and use the global variable queryString.

    We provide dist files under dist folder in @umdjs/query-string's npm package. You can also download these files directly from or unpkg.

    <!doctype html>
    <html lang="zh-CN">
      <head>
        <script src="//unpkg.com/@umdjs/query-string/dist/index.min.js" />
      </head>
      <body>
        <script>
          console.log(location.search);
          //=> '?foo=bar'
    
          // ~ Use `queryString` from global:
          const parsed = queryString.parse(location.search);
          console.log(parsed);
          //=> {foo: 'bar'}
    
          console.log(location.hash);
          //=> '#token=bada55cafe'
    
          const parsedHash = queryString.parse(location.hash);
          console.log(parsedHash);
          //=> {token: 'bada55cafe'}
    
          parsed.foo = 'unicorn';
          parsed.ilike = 'pizza';
    
          const stringified = queryString.stringify(parsed);
          //=> 'foo=unicorn&ilike=pizza'
    
          location.search = stringified;
          // note that `location.search` automatically prepends a question mark
          console.log(location.search);
          //=> '?foo=unicorn&ilike=pizza'
        </script>
      </body>
    </html>

    ⌨️ Local Development

    You can use Github Codespaces for online development:

    Or clone it for local development:

    git clone https://github.com/Carrotzpc/umdjs.git
    cd umdjs
    pnpm install
    pnpm dev

    🗒️ Changelog

    See query-string/CHANGELOG.md for detail.

    🤝 Contributing

    Contributions of all types are more than welcome, if you are interested in contributing code, feel free to check out our GitHub Issues to get stuck in to show us what you’re made of.


    📝 License

    Copyright © 2024 Carrotzpc.
    This project is MIT licensed.