116 lines
6.9 KiB
JSON
116 lines
6.9 KiB
JSON
|
{
|
||
|
"_args": [
|
||
|
[
|
||
|
{
|
||
|
"raw": "encodeurl@~1.0.1",
|
||
|
"scope": null,
|
||
|
"escapedName": "encodeurl",
|
||
|
"name": "encodeurl",
|
||
|
"rawSpec": "~1.0.1",
|
||
|
"spec": ">=1.0.1 <1.1.0",
|
||
|
"type": "range"
|
||
|
},
|
||
|
"/home/jdaugherty/work/GT2/GT2-Android/node_modules/express"
|
||
|
]
|
||
|
],
|
||
|
"_from": "encodeurl@>=1.0.1 <1.1.0",
|
||
|
"_id": "encodeurl@1.0.2",
|
||
|
"_inCache": true,
|
||
|
"_location": "/encodeurl",
|
||
|
"_nodeVersion": "6.11.1",
|
||
|
"_npmOperationalInternal": {
|
||
|
"host": "s3://npm-registry-packages",
|
||
|
"tmp": "tmp/encodeurl-1.0.2.tgz_1516591169672_0.5424360500182956"
|
||
|
},
|
||
|
"_npmUser": {
|
||
|
"name": "dougwilson",
|
||
|
"email": "doug@somethingdoug.com"
|
||
|
},
|
||
|
"_npmVersion": "3.10.10",
|
||
|
"_phantomChildren": {},
|
||
|
"_requested": {
|
||
|
"raw": "encodeurl@~1.0.1",
|
||
|
"scope": null,
|
||
|
"escapedName": "encodeurl",
|
||
|
"name": "encodeurl",
|
||
|
"rawSpec": "~1.0.1",
|
||
|
"spec": ">=1.0.1 <1.1.0",
|
||
|
"type": "range"
|
||
|
},
|
||
|
"_requiredBy": [
|
||
|
"/express",
|
||
|
"/finalhandler",
|
||
|
"/send",
|
||
|
"/serve-static"
|
||
|
],
|
||
|
"_resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
|
||
|
"_shasum": "ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59",
|
||
|
"_shrinkwrap": null,
|
||
|
"_spec": "encodeurl@~1.0.1",
|
||
|
"_where": "/home/jdaugherty/work/GT2/GT2-Android/node_modules/express",
|
||
|
"bugs": {
|
||
|
"url": "https://github.com/pillarjs/encodeurl/issues"
|
||
|
},
|
||
|
"contributors": [
|
||
|
{
|
||
|
"name": "Douglas Christopher Wilson",
|
||
|
"email": "doug@somethingdoug.com"
|
||
|
}
|
||
|
],
|
||
|
"dependencies": {},
|
||
|
"description": "Encode a URL to a percent-encoded form, excluding already-encoded sequences",
|
||
|
"devDependencies": {
|
||
|
"eslint": "3.19.0",
|
||
|
"eslint-config-standard": "10.2.1",
|
||
|
"eslint-plugin-import": "2.8.0",
|
||
|
"eslint-plugin-node": "5.2.1",
|
||
|
"eslint-plugin-promise": "3.6.0",
|
||
|
"eslint-plugin-standard": "3.0.1",
|
||
|
"istanbul": "0.4.5",
|
||
|
"mocha": "2.5.3"
|
||
|
},
|
||
|
"directories": {},
|
||
|
"dist": {
|
||
|
"shasum": "ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59",
|
||
|
"tarball": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz"
|
||
|
},
|
||
|
"engines": {
|
||
|
"node": ">= 0.8"
|
||
|
},
|
||
|
"files": [
|
||
|
"LICENSE",
|
||
|
"HISTORY.md",
|
||
|
"README.md",
|
||
|
"index.js"
|
||
|
],
|
||
|
"gitHead": "1a7301e330bf20fd7c8c173102315e45cd1f5d1e",
|
||
|
"homepage": "https://github.com/pillarjs/encodeurl#readme",
|
||
|
"keywords": [
|
||
|
"encode",
|
||
|
"encodeurl",
|
||
|
"url"
|
||
|
],
|
||
|
"license": "MIT",
|
||
|
"maintainers": [
|
||
|
{
|
||
|
"name": "dougwilson",
|
||
|
"email": "doug@somethingdoug.com"
|
||
|
}
|
||
|
],
|
||
|
"name": "encodeurl",
|
||
|
"optionalDependencies": {},
|
||
|
"readme": "# encodeurl\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\nEncode a URL to a percent-encoded form, excluding already-encoded sequences\n\n## Installation\n\nThis is a [Node.js](https://nodejs.org/en/) module available through the\n[npm registry](https://www.npmjs.com/). Installation is done using the\n[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):\n\n```sh\n$ npm install encodeurl\n```\n\n## API\n\n```js\nvar encodeUrl = require('encodeurl')\n```\n\n### encodeUrl(url)\n\nEncode a URL to a percent-encoded form, excluding already-encoded sequences.\n\nThis function will take an already-encoded URL and encode all the non-URL\ncode points (as UTF-8 byte sequences). This function will not encode the\n\"%\" character unless it is not part of a valid sequence (`%20` will be\nleft as-is, but `%foo` will be encoded as `%25foo`).\n\nThis encode is meant to be \"safe\" and does not throw errors. It will try as\nhard as it can to properly encode the given URL, including replacing any raw,\nunpaired surrogate pairs with the Unicode replacement character prior to\nencoding.\n\nThis function is _similar_ to the intrinsic function `encodeURI`, except it\nwill not encode the `%` character if that is part of a valid sequence, will\nnot encode `[` and `]` (for IPv6 hostnames) and will replace raw, unpaired\nsurrogate pairs with the Unicode replacement character (instead of throwing).\n\n## Examples\n\n### Encode a URL containing user-controled data\n\n```js\nvar encodeUrl = require('encodeurl')\nvar escapeHtml = require('escape-html')\n\nhttp.createServer(function onRequest (req, res) {\n // get encoded form of inbound url\n var url = encodeUrl(req.url)\n\n // create html message\n var body = '<p>Location ' + escapeHtml(url) + ' not found</p>'\n\n // send a 404\n res.statusCode = 404\n res.setHeader('Content-Type', 'text/html; charset=UTF-8')\n res.setHeader('Content-Length', String(Buffer.byteLength(body, 'utf-8')))\n res.end(body, 'utf-8')\n})\n```\n\n### Encode a URL for use in a header field\n\n```js\nvar encodeUrl = require('encodeurl')\nvar escapeHtml = require('escape-html')\nvar url = require('url')\n\nhttp.createServer(function onRequest (req, res) {\n // parse inbound url\n var href = url.parse(req)\n\n // set new host for redirect\n href.host = 'localhost'\n href.protocol = 'https:'\n href.slashes = true\n\n // create location header\n var location = encodeUrl(url.format(href))\n\n // create html message\n var body = '<p>Redirecting to new site: ' + escapeHtml(location) + '</p>'\n\n // send a 301\n res.statusCode = 301\n res.setHeader('Content-Type', 'text/html; charset=UTF-8')\n res.setHeader('Content-Length', String(Buffer.byteLength(body, 'utf-8')))\n res.setHeader('Location', location)\n res.end(body, 'utf-8')\n})\n```\n\n## Testing\n\n```sh\n$ npm test\n$ npm run lint\n```\n\n## References\n\n- [RFC 3986: Uniform Resource Identifier (URI): Generic Syntax][rfc-3986]\n- [WHATWG URL Living Standard][whatwg-url]\n\n[rfc-3986]: https://tools.ietf.org/html/rfc3986\n[whatwg-url]: https://url.spec.whatwg.org/\n\n## License\n\n[MIT](LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/encodeurl.svg\n[npm-url]: https://npmjs.org/package/encodeurl\n[node-version-image]: https://img.shields.io/node/v/encodeurl.svg\n[node-version-url]: https://nodejs.org/en/download\n[travis-image]: https://img.shields.io/travis/pillarjs/encodeurl.svg\n[travis-url]: https://travis-ci.org/pillarjs/encodeurl\n[coveralls-image]: https://img.shields.io/coveralls/pillarjs/encodeurl.svg\n[coveralls-url]: https://coveralls.io/r/pillarjs/encodeurl?branch=master\n[downloads-image]: https://img.shields.io/npm/dm/encodeurl.svg\n[downloads-url]: https://npmjs.org/package/encodeurl\n",
|
||
|
"readmeFilename": "README.md",
|
||
|
"repository": {
|
||
|
"type": "git",
|
||
|
"url": "git+https://github.com/pillarjs/encodeurl.git"
|
||
|
},
|
||
|
"scripts": {
|
||
|
"lint": "eslint .",
|
||
|
"test": "mocha --reporter spec --bail --check-leaks test/",
|
||
|
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
|
||
|
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
|
||
|
},
|
||
|
"version": "1.0.2"
|
||
|
}
|