UNPKG

motion

Version:

motion - moving development forward

80 lines (79 loc) 5.86 kB
{ "_args": [ [ "parseurl@https://registry.npmjs.org/parseurl/-/parseurl-1.3.1.tgz", "/Users/nw/flint/packages/flint" ] ], "_from": "parseurl@>=1.3.0 <1.4.0", "_id": "parseurl@1.3.1", "_inCache": true, "_location": "/parseurl", "_phantomChildren": {}, "_requested": { "name": "parseurl", "raw": "parseurl@https://registry.npmjs.org/parseurl/-/parseurl-1.3.1.tgz", "rawSpec": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.1.tgz", "scope": null, "spec": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.1.tgz", "type": "remote" }, "_requiredBy": [ "/express", "/serve-static" ], "_resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.1.tgz", "_shasum": "c8ab8c9223ba34888aa64a297b28853bec18da56", "_shrinkwrap": null, "_spec": "parseurl@https://registry.npmjs.org/parseurl/-/parseurl-1.3.1.tgz", "_where": "/Users/nw/flint/packages/flint", "author": { "email": "me@jongleberry.com", "name": "Jonathan Ong", "url": "http://jongleberry.com" }, "bugs": { "url": "https://github.com/pillarjs/parseurl/issues" }, "contributors": [ { "name": "Douglas Christopher Wilson", "email": "doug@somethingdoug.com" } ], "dependencies": {}, "description": "parse a url with memoization", "devDependencies": { "beautify-benchmark": "0.2.4", "benchmark": "2.0.0", "fast-url-parser": "1.1.3", "istanbul": "0.4.2", "mocha": "~1.21.5" }, "engines": { "node": ">= 0.8" }, "files": [ "HISTORY.md", "LICENSE", "README.md", "index.js" ], "homepage": "https://github.com/pillarjs/parseurl#readme", "license": "MIT", "name": "parseurl", "optionalDependencies": {}, "readme": "# parseurl\n\n[![NPM Version][npm-image]][npm-url]\n[![NPM Downloads][downloads-image]][downloads-url]\n[![Node.js Version][node-version-image]][node-version-url]\n[![Build Status][travis-image]][travis-url]\n[![Test Coverage][coveralls-image]][coveralls-url]\n\nParse a URL with memoization.\n\n## Install\n\n```bash\n$ npm install parseurl\n```\n\n## API\n\n```js\nvar parseurl = require('parseurl')\n```\n\n### parseurl(req)\n\nParse the URL of the given request object (looks at the `req.url` property)\nand return the result. The result is the same as `url.parse` in Node.js core.\nCalling this function multiple times on the same `req` where `req.url` does\nnot change will return a cached parsed object, rather than parsing again.\n\n### parseurl.original(req)\n\nParse the original URL of the given request object and return the result.\nThis works by trying to parse `req.originalUrl` if it is a string, otherwise\nparses `req.url`. The result is the same as `url.parse` in Node.js core.\nCalling this function multiple times on the same `req` where `req.originalUrl`\ndoes not change will return a cached parsed object, rather than parsing again.\n\n## Benchmark\n\n```bash\n$ npm run-script bench\n\n> parseurl@1.3.1 bench nodejs-parseurl\n> node benchmark/index.js\n\n> node benchmark/fullurl.js\n\n Parsing URL \"http://localhost:8888/foo/bar?user=tj&pet=fluffy\"\n\n 1 test completed.\n 2 tests completed.\n 3 tests completed.\n\n fasturl x 1,290,780 ops/sec ±0.46% (195 runs sampled)\n nativeurl x 56,401 ops/sec ±0.22% (196 runs sampled)\n parseurl x 55,231 ops/sec ±0.22% (194 runs sampled)\n\n> node benchmark/pathquery.js\n\n Parsing URL \"/foo/bar?user=tj&pet=fluffy\"\n\n 1 test completed.\n 2 tests completed.\n 3 tests completed.\n\n fasturl x 1,986,668 ops/sec ±0.27% (190 runs sampled)\n nativeurl x 98,740 ops/sec ±0.21% (195 runs sampled)\n parseurl x 2,628,171 ops/sec ±0.36% (195 runs sampled)\n\n> node benchmark/samerequest.js\n\n Parsing URL \"/foo/bar?user=tj&pet=fluffy\" on same request object\n\n 1 test completed.\n 2 tests completed.\n 3 tests completed.\n\n fasturl x 2,184,468 ops/sec ±0.40% (194 runs sampled)\n nativeurl x 99,437 ops/sec ±0.71% (194 runs sampled)\n parseurl x 10,498,005 ops/sec ±0.61% (186 runs sampled)\n\n> node benchmark/simplepath.js\n\n Parsing URL \"/foo/bar\"\n\n 1 test completed.\n 2 tests completed.\n 3 tests completed.\n\n fasturl x 4,535,825 ops/sec ±0.27% (191 runs sampled)\n nativeurl x 98,769 ops/sec ±0.54% (191 runs sampled)\n parseurl x 4,164,865 ops/sec ±0.34% (192 runs sampled)\n\n> node benchmark/slash.js\n\n Parsing URL \"/\"\n\n 1 test completed.\n 2 tests completed.\n 3 tests completed.\n\n fasturl x 4,908,405 ops/sec ±0.42% (191 runs sampled)\n nativeurl x 100,945 ops/sec ±0.59% (188 runs sampled)\n parseurl x 4,333,208 ops/sec ±0.27% (194 runs sampled)\n```\n\n## License\n\n [MIT](LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/parseurl.svg\n[npm-url]: https://npmjs.org/package/parseurl\n[node-version-image]: https://img.shields.io/node/v/parseurl.svg\n[node-version-url]: http://nodejs.org/download/\n[travis-image]: https://img.shields.io/travis/pillarjs/parseurl/master.svg\n[travis-url]: https://travis-ci.org/pillarjs/parseurl\n[coveralls-image]: https://img.shields.io/coveralls/pillarjs/parseurl/master.svg\n[coveralls-url]: https://coveralls.io/r/pillarjs/parseurl?branch=master\n[downloads-image]: https://img.shields.io/npm/dm/parseurl.svg\n[downloads-url]: https://npmjs.org/package/parseurl\n", "readmeFilename": "README.md", "repository": { "type": "git", "url": "git+https://github.com/pillarjs/parseurl.git" }, "scripts": { "bench": "node benchmark/index.js", "test": "mocha --check-leaks --bail --reporter spec test/", "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --reporter dot test/", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec test/" }, "version": "1.3.1" }