@zkochan/pnpm
Version:
Fast, disk space efficient package manager
120 lines (119 loc) • 6.74 kB
JSON
{
"_args": [
[
{
"raw": "normalize-url@2.0.1",
"scope": null,
"escapedName": "normalize-url",
"name": "normalize-url",
"rawSpec": "2.0.1",
"spec": "2.0.1",
"type": "version"
},
"/home/zkochan/src/pnpm/packages/pnpm/node_modules/cacheable-request"
]
],
"_from": "normalize-url@2.0.1",
"_id": "normalize-url@2.0.1",
"_inCache": true,
"_location": "/normalize-url",
"_nodeVersion": "9.2.0",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/normalize-url-2.0.1.tgz_1514211316216_0.5772104728966951"
},
"_npmUser": {
"name": "sindresorhus",
"email": "sindresorhus@gmail.com"
},
"_npmVersion": "5.5.1",
"_phantomChildren": {},
"_requested": {
"raw": "normalize-url@2.0.1",
"scope": null,
"escapedName": "normalize-url",
"name": "normalize-url",
"rawSpec": "2.0.1",
"spec": "2.0.1",
"type": "version"
},
"_requiredBy": [
"/cacheable-request"
],
"_resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-2.0.1.tgz",
"_shasum": "835a9da1551fa26f70e92329069a23aa6574d7e6",
"_shrinkwrap": null,
"_spec": "normalize-url@2.0.1",
"_where": "/home/zkochan/src/pnpm/packages/pnpm/node_modules/cacheable-request",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"bugs": {
"url": "https://github.com/sindresorhus/normalize-url/issues"
},
"dependencies": {
"prepend-http": "^2.0.0",
"query-string": "^5.0.1",
"sort-keys": "^2.0.0"
},
"description": "Normalize a URL",
"devDependencies": {
"ava": "*",
"xo": "*"
},
"directories": {},
"dist": {
"integrity": "sha512-D6MUW4K/VzoJ4rJ01JFKxDrtY1v9wrgzCX5f2qj/lzH1m/lW6MhUZFKerVsnyjOhOsYzI9Kqqak+10l4LvLpMw==",
"shasum": "835a9da1551fa26f70e92329069a23aa6574d7e6",
"tarball": "https://registry.npmjs.org/normalize-url/-/normalize-url-2.0.1.tgz"
},
"engines": {
"node": ">=4"
},
"files": [
"index.js"
],
"gitHead": "f4df6060b1bbceb1e008250f57756a3eba3e2429",
"homepage": "https://github.com/sindresorhus/normalize-url#readme",
"keywords": [
"normalize",
"url",
"uri",
"address",
"string",
"normalization",
"normalisation",
"query",
"querystring",
"unicode",
"simplify",
"strip",
"trim",
"canonical"
],
"license": "MIT",
"maintainers": [
{
"name": "sindresorhus",
"email": "sindresorhus@gmail.com"
},
{
"name": "kevva",
"email": "kevinmartensson@gmail.com"
}
],
"name": "normalize-url",
"optionalDependencies": {},
"readme": "# normalize-url [](https://travis-ci.org/sindresorhus/normalize-url)\n\n> [Normalize](https://en.wikipedia.org/wiki/URL_normalization) a URL\n\nUseful when you need to display, store, deduplicate, sort, compare, etc, URLs.\n\n\n## Install\n\n```\n$ npm install normalize-url\n```\n\n\n## Usage\n\n```js\nconst normalizeUrl = require('normalize-url');\n\nnormalizeUrl('sindresorhus.com');\n//=> 'http://sindresorhus.com'\n\nnormalizeUrl('HTTP://xn--xample-hva.com:80/?b=bar&a=foo');\n//=> 'http://êxample.com/?a=foo&b=bar'\n```\n\n\n## API\n\n### normalizeUrl(url, [options])\n\n#### url\n\nType: `string`\n\nURL to normalize.\n\n#### options\n\nType: `Object`\n\n##### normalizeProtocol\n\nType: `boolean`<br>\nDefault: `true`\n\nPrepend `http:` to the URL if it's protocol-relative.\n\n```js\nnormalizeUrl('//sindresorhus.com:80/');\n//=> 'http://sindresorhus.com'\n\nnormalizeUrl('//sindresorhus.com:80/', {normalizeProtocol: false});\n//=> '//sindresorhus.com'\n```\n\n##### normalizeHttps\n\nType: `boolean`<br>\nDefault: `false`\n\nNormalize `https:` URLs to `http:`.\n\n```js\nnormalizeUrl('https://sindresorhus.com:80/');\n//=> 'https://sindresorhus.com'\n\nnormalizeUrl('https://sindresorhus.com:80/', {normalizeHttps: true});\n//=> 'http://sindresorhus.com'\n```\n\n##### stripFragment\n\nType: `boolean`<br>\nDefault: `true`\n\nRemove the fragment at the end of the URL.\n\n```js\nnormalizeUrl('sindresorhus.com/about.html#contact');\n//=> 'http://sindresorhus.com/about.html'\n\nnormalizeUrl('sindresorhus.com/about.html#contact', {stripFragment: false});\n//=> 'http://sindresorhus.com/about.html#contact'\n```\n\n##### stripWWW\n\nType: `boolean`<br>\nDefault: `true`\n\nRemove `www.` from the URL.\n\n```js\nnormalizeUrl('http://www.sindresorhus.com/about.html#contact');\n//=> 'http://sindresorhus.com/about.html#contact'\n\nnormalizeUrl('http://www.sindresorhus.com/about.html#contact', {stripWWW: false});\n//=> 'http://www.sindresorhus.com/about.html#contact'\n```\n\n##### removeQueryParameters\n\nType: `Array<RegExp|string>`<br>\nDefault: `[/^utm_\\w+/i]`\n\nRemove query parameters that matches any of the provided strings or regexes.\n\n```js\nnormalizeUrl('www.sindresorhus.com?foo=bar&ref=test_ref', {\n\tremoveQueryParameters: ['ref']\n});\n//=> 'http://sindresorhus.com/?foo=bar'\n```\n\n##### removeTrailingSlash\n\nType: `boolean`<br>\nDefault: `true`\n\nRemove trailing slash.\n\n**Note:** Trailing slash is always removed if the URL doesn't have a pathname.\n\n```js\nnormalizeUrl('http://sindresorhus.com/redirect/');\n//=> 'http://sindresorhus.com/redirect'\n\nnormalizeUrl('http://sindresorhus.com/redirect/', {removeTrailingSlash: false});\n//=> 'http://sindresorhus.com/redirect/'\n\nnormalizeUrl('http://sindresorhus.com/', {removeTrailingSlash: false});\n//=> 'http://sindresorhus.com'\n```\n\n##### removeDirectoryIndex\n\nType: `boolean` `Array<RegExp|string>`<br>\nDefault: `false`\n\nRemove the default directory index file from path that matches any of the provided strings or regexes. When `true`, the regex `/^index\\.[a-z]+$/` is used.\n\n```js\nnormalizeUrl('www.sindresorhus.com/foo/default.php', {\n\tremoveDirectoryIndex: [/^default\\.[a-z]+$/]\n});\n//=> 'http://sindresorhus.com/foo'\n```\n\n##### sortQueryParameters\n\nType: `boolean`<br>\nDefault: `true`\n\nSort the query parameters alphabetically by key.\n\n```js\nnormalizeUrl('www.sindresorhus.com?b=two&a=one&c=three', {\n\tsortQueryParameters: false\n});\n//=> 'http://sindresorhus.com/?b=two&a=one&c=three'\n```\n\n\n## Related\n\n- [compare-urls](https://github.com/sindresorhus/compare-urls) - Compare URLs by first normalizing them\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n",
"readmeFilename": "readme.md",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/normalize-url.git"
},
"scripts": {
"test": "xo && ava"
},
"version": "2.0.1"
}