UNPKG

motion

Version:

motion - moving development forward

81 lines (80 loc) 3.76 kB
{ "_args": [ [ "query-string@https://registry.npmjs.org/query-string/-/query-string-3.0.0.tgz", "/Users/nw/flint/packages/flint" ] ], "_from": "query-string@>=3.0.0 <4.0.0", "_id": "query-string@3.0.0", "_inCache": true, "_location": "/query-string", "_phantomChildren": {}, "_requested": { "name": "query-string", "raw": "query-string@https://registry.npmjs.org/query-string/-/query-string-3.0.0.tgz", "rawSpec": "https://registry.npmjs.org/query-string/-/query-string-3.0.0.tgz", "scope": null, "spec": "https://registry.npmjs.org/query-string/-/query-string-3.0.0.tgz", "type": "remote" }, "_requiredBy": [ "/normalize-url" ], "_resolved": "https://registry.npmjs.org/query-string/-/query-string-3.0.0.tgz", "_shasum": "02fd306f0432040b91b11063f9404fe1bbd4ba7b", "_shrinkwrap": null, "_spec": "query-string@https://registry.npmjs.org/query-string/-/query-string-3.0.0.tgz", "_where": "/Users/nw/flint/packages/flint", "author": { "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", "url": "sindresorhus.com" }, "bugs": { "url": "https://github.com/sindresorhus/query-string/issues" }, "dependencies": { "strict-uri-encode": "^1.0.0" }, "description": "Parse and stringify URL query strings", "devDependencies": { "ava": "*", "xo": "*" }, "engines": { "node": ">=0.10.0" }, "files": [ "index.js" ], "homepage": "https://github.com/sindresorhus/query-string#readme", "keywords": [ "browser", "decode", "encode", "param", "parameter", "parse", "qs", "query", "querystring", "string", "stringify", "uri", "url" ], "license": "MIT", "name": "query-string", "optionalDependencies": {}, "readme": "# query-string [![Build Status](https://travis-ci.org/sindresorhus/query-string.svg?branch=master)](https://travis-ci.org/sindresorhus/query-string)\n\n> Parse and stringify URL [query strings](http://en.wikipedia.org/wiki/Query_string)\n\n\n## Install\n\n```\n$ npm install --save query-string\n```\n\n\n## Usage\n\n```js\nconst queryString = require('query-string');\n\nconsole.log(location.search);\n//=> '?foo=bar'\n\nconst parsed = queryString.parse(location.search);\nconsole.log(parsed);\n//=> {foo: 'bar'}\n\nconsole.log(location.hash);\n//=> '#token=bada55cafe'\n\nconst parsedHash = queryString.parse(location.hash);\nconsole.log(parsedHash);\n//=> {token: 'bada55cafe'}\n\nparsed.foo = 'unicorn';\nparsed.ilike = 'pizza';\n\nlocation.search = queryString.stringify(parsed);\n\nconsole.log(location.search);\n//=> '?foo=unicorn&ilike=pizza'\n```\n\n\n## API\n\n### .parse(*string*)\n\nParse a query string into an object. Leading `?` or `#` are ignored, so you can pass `location.search` or `location.hash` directly.\n\n### .stringify(*object*)\n\nStringify an object into a query string, sorting the keys.\n\n### .extract(*string*)\n\nExtract a query string from a URL that can be passed into `.parse()`.\n\n\n## Nesting\n\nThis module intentionally doesn't support nesting as it's not spec'd and varies between implementations, which causes a lot of [edge cases](https://github.com/visionmedia/node-querystring/issues).\n\nYou're much better off just converting the object to a JSON string:\n\n```js\nqueryString.stringify({\n\tfoo: 'bar',\n\tnested: JSON.stringify({\n\t\tunicorn: 'cake'\n\t})\n});\n//=> 'foo=bar&nested=%7B%22unicorn%22%3A%22cake%22%7D'\n```\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n", "readmeFilename": "readme.md", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/query-string.git" }, "scripts": { "test": "xo && ava" }, "version": "3.0.0" }