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
📦 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="" />
</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🤝 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.