{"_id":"get-url-origin","_rev":"1-a04158eb36c19d4bccc11bd520da5156","name":"get-url-origin","description":"Get origin from url string in Node.js","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.1":{"name":"get-url-origin","version":"1.0.1","description":"Get origin from url string in Node.js","keywords":["node.js","origin","url"],"homepage":"https://github.com/azu/node-get-url-origin","bugs":{"url":"https://github.com/azu/node-get-url-origin/issues"},"license":"MIT","author":{"name":"azu"},"files":["bin/","lib/","src/"],"main":"lib/node-get-url-origin.js","types":"lib/node-get-url-origin.d.ts","directories":{"lib":"lib","test":"test"},"repository":{"type":"git","url":"git+https://github.com/azu/node-get-url-origin.git"},"scripts":{"build":"cross-env NODE_ENV=production tsc -p .","precommit":"lint-staged","postcommit":"git reset","prepublish":"npm run --if-present build","test":"mocha \"test/**/*.ts\"","prettier":"prettier --write \"**/*.{js,jsx,ts,tsx,css}\"","watch":"tsc -p . --watch"},"devDependencies":{"@types/mocha":"^2.2.46","@types/node":"^7.0.52","cross-env":"^5.1.3","husky":"^0.14.3","lint-staged":"^6.0.0","mocha":"^4.1.0","prettier":"^1.9.2","ts-node":"^4.1.0","typescript":"^2.6.2"},"lint-staged":{"*.{js,jsx,ts,tsx,css}":["prettier --write","git add"]},"prettier":{"singleQuote":false,"printWidth":120,"tabWidth":4},"gitHead":"da8b4be97dbf32a6461027c0714db306d48cd5e0","_id":"get-url-origin@1.0.1","_npmVersion":"5.5.1","_nodeVersion":"9.2.1","_npmUser":{"name":"azu","email":"azuciao@gmail.com"},"dist":{"integrity":"sha512-MMSKo16gB2+6CjWy55jNdIAqUEaKgw3LzZCb8wVVtFrhoQ78EXyuYXxDdn3COI3A4Xr4ZfM3fZa9RTjO6DOTxw==","shasum":"edebfcc085433e84c6b32a5738b0996edfd5a7b9","tarball":"https://registry.npmjs.org/get-url-origin/-/get-url-origin-1.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrUbYiLDm0mBvk78IxRS6Mu/wP8DI3XS8uqXT0wf/urgIgcZz6dpou1y5esEc3tCKOmTNw+qmAZdH1ETgeoc6pGGQ="}]},"maintainers":[{"name":"azu","email":"azuciao@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/get-url-origin-1.0.1.tgz_1515117116841_0.6170512742828578"}}},"readme":"# get-url-origin [![Build Status](https://travis-ci.org/azu/node-get-url-origin.svg?branch=master)](https://travis-ci.org/azu/node-get-url-origin)\n\nGet origin from url string in Node.js.\n\nThis library based on Node.js's [Legacy URL API](https://nodejs.org/api/url.html#url_legacy_url_api \"Legacy URL API\")(`require('url').Url`)\n\nIf you can use Node.js >=7, please use New built-in [URL module](https://nodejs.org/api/url.html#url_url_origin).\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n    npm install get-url-origin\n\n## Usage\n\n### API\n\n```ts\n/**\n * Return URL origin string from `urlString`.\n * If origin is not found, return null\n * @param {string} urlString\n * @returns {string | null}\n * @see https://url.spec.whatwg.org/#origin\n */\nexport declare const getURLOrigin: (urlString: string) => string | null;\n```\n\n### Example\n\n```ts\ngetURLOrigin('https://example.com/file/to/path?example'); // => 'https://example.com'\ngetURLOrigin('http://example.com:80/path/to/file'); // => 'http://example.com:80'\n```\n\n## Changelog\n\nSee [Releases page](https://github.com/azu/node-get-url-origin/releases).\n\n## Running tests\n\nInstall devDependencies and Run `npm test`:\n\n    npm i -d && npm test\n\n## Contributing\n\nPull requests and stars are always welcome.\n\nFor bugs and feature requests, [please create an issue](https://github.com/azu/node-get-url-origin/issues).\n\n1. Fork it!\n2. Create your feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n5. Submit a pull request :D\n\n## Author\n\n- [github/azu](https://github.com/azu)\n- [twitter/azu_re](https://twitter.com/azu_re)\n\n## License\n\nMIT © azu\n","maintainers":[{"name":"azu","email":"azuciao@gmail.com"}],"time":{"modified":"2022-05-03T15:09:38.658Z","created":"2018-01-05T01:51:56.896Z","1.0.1":"2018-01-05T01:51:56.896Z"},"homepage":"https://github.com/azu/node-get-url-origin","keywords":["node.js","origin","url"],"repository":{"type":"git","url":"git+https://github.com/azu/node-get-url-origin.git"},"author":{"name":"azu"},"bugs":{"url":"https://github.com/azu/node-get-url-origin/issues"},"license":"MIT","readmeFilename":"README.md"}