UNPKG

motion

Version:

motion - moving development forward

88 lines (87 loc) 4.13 kB
{ "_args": [ [ "normalize-url@https://registry.npmjs.org/normalize-url/-/normalize-url-1.4.0.tgz", "/Users/nw/flint/packages/flint" ] ], "_from": "normalize-url@>=1.3.1 <2.0.0", "_id": "normalize-url@1.4.0", "_inCache": true, "_location": "/normalize-url", "_phantomChildren": {}, "_requested": { "name": "normalize-url", "raw": "normalize-url@https://registry.npmjs.org/normalize-url/-/normalize-url-1.4.0.tgz", "rawSpec": "https://registry.npmjs.org/normalize-url/-/normalize-url-1.4.0.tgz", "scope": null, "spec": "https://registry.npmjs.org/normalize-url/-/normalize-url-1.4.0.tgz", "type": "remote" }, "_requiredBy": [ "/postcss-normalize-url" ], "_resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-1.4.0.tgz", "_shasum": "8ae93e97ddf66f17544c1f12a2dc0c0e4b5762ff", "_shrinkwrap": null, "_spec": "normalize-url@https://registry.npmjs.org/normalize-url/-/normalize-url-1.4.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/normalize-url/issues" }, "dependencies": { "object-assign": "^4.0.1", "prepend-http": "^1.0.0", "query-string": "^3.0.0", "sort-keys": "^1.0.0" }, "description": "Normalize a URL", "devDependencies": { "ava": "*", "xo": "*" }, "engines": { "node": ">=0.10.0" }, "files": [ "index.js" ], "homepage": "https://github.com/sindresorhus/normalize-url#readme", "keywords": [ "address", "canonical", "normalisation", "normalise", "normalization", "normalize", "query", "querystring", "simplify", "str", "string", "string", "strip", "trim", "unicode", "uri", "url" ], "license": "MIT", "name": "normalize-url", "optionalDependencies": {}, "readme": "# normalize-url [![Build Status](https://travis-ci.org/sindresorhus/normalize-url.svg?branch=master)](https://travis-ci.org/sindresorhus/normalize-url)\n\n> [Normalize](http://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 --save 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\n##### normalizeProtocol\n\nType: `boolean` \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##### stripFragment\n\nType: `boolean` \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` \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\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](http://sindresorhus.com)\n", "readmeFilename": "readme.md", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/normalize-url.git" }, "scripts": { "test": "xo && ava" }, "version": "1.4.0" }