{"_id":"@zkochan/npm-package-arg","_rev":"942544","name":"@zkochan/npm-package-arg","description":"Parse the things that can be arguments to `npm install`","dist-tags":{"latest":"2.0.1","next":"2.0.0"},"maintainers":[{"name":"zkochan","email":"zoltan.kochan+github@gmail.com"}],"time":{"modified":"2021-09-23T02:08:45.000Z","created":"2017-11-18T22:53:51.597Z","2.0.1":"2021-03-24T01:38:34.999Z","2.0.0":"2020-05-02T20:12:38.586Z","1.0.2":"2019-03-31T17:44:10.938Z","1.0.1":"2018-11-28T21:35:57.870Z","1.0.0":"2017-11-18T22:53:51.597Z"},"users":{},"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"repository":{"type":"git","url":"git+https://github.com/zkochan/npm-package-arg.git"},"versions":{"2.0.1":{"name":"@zkochan/npm-package-arg","version":"2.0.1","description":"Parse the things that can be arguments to `npm install`","main":"npa.js","engines":{"node":">=10.13"},"directories":{"test":"test"},"dependencies":{"hosted-git-info":"^4.0.1","semver":"^7.3.5","validate-npm-package-name":"^3.0.0"},"devDependencies":{"standard":"14.3.3","tap":"^14.10.7"},"scripts":{"test":"standard && tap -J --coverage test/*.js"},"repository":{"type":"git","url":"git+https://github.com/zkochan/npm-package-arg.git"},"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"license":"ISC","bugs":{"url":"https://github.com/zkochan/npm-package-arg/issues"},"homepage":"https://github.com/zkochan/npm-package-arg","gitHead":"f48d6842409cf595b5da4f2031528e5a90ef97c6","_id":"@zkochan/npm-package-arg@2.0.1","_nodeVersion":"12.19.0","_npmVersion":"6.14.11","dist":{"shasum":"f969c9522f642c7d80e48cbeb909c1dec3216482","size":5240,"noattachment":false,"key":"/@zkochan/npm-package-arg/-/@zkochan/npm-package-arg-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@zkochan/npm-package-arg/download/@zkochan/npm-package-arg-2.0.1.tgz"},"_npmUser":{"name":"zkochan","email":"z@kochan.io"},"maintainers":[{"name":"zkochan","email":"zoltan.kochan+github@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/npm-package-arg_2.0.1_1616549914843_0.2737856836052701"},"_hasShrinkwrap":false,"publish_time":1616549914999,"_cnpm_publish_time":1616549914999},"2.0.0":{"name":"@zkochan/npm-package-arg","version":"2.0.0","description":"Parse the things that can be arguments to `npm install`","main":"npa.js","engines":{"node":">=10.13"},"directories":{"test":"test"},"dependencies":{"hosted-git-info":"^3.0.4","semver":"^7.3.2","validate-npm-package-name":"^3.0.0"},"devDependencies":{"standard":"14.3.3","tap":"^14.10.7"},"scripts":{"test":"standard && tap -J --coverage test/*.js"},"repository":{"type":"git","url":"git+https://github.com/zkochan/npm-package-arg.git"},"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"license":"ISC","bugs":{"url":"https://github.com/zkochan/npm-package-arg/issues"},"homepage":"https://github.com/zkochan/npm-package-arg","readmeFilename":"README.md","gitHead":"e276ab22578d2e98b8f300ba020d988a4221af04","_id":"@zkochan/npm-package-arg@2.0.0","_nodeVersion":"12.14.1","_npmVersion":"6.14.4","dist":{"shasum":"8f4d582be16532fc15313a6bc7f0066e1dc0abac","size":5248,"noattachment":false,"key":"/@zkochan/npm-package-arg/-/@zkochan/npm-package-arg-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@zkochan/npm-package-arg/download/@zkochan/npm-package-arg-2.0.0.tgz"},"maintainers":[{"name":"zkochan","email":"zoltan.kochan+github@gmail.com"}],"_npmUser":{"name":"zkochan","email":"z@kochan.io"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/npm-package-arg_2.0.0_1588450358461_0.5815261461184185"},"_hasShrinkwrap":false,"publish_time":1588450358586,"_cnpm_publish_time":1588450358586},"1.0.2":{"name":"@zkochan/npm-package-arg","version":"1.0.2","description":"Parse the things that can be arguments to `npm install`","main":"npa.js","directories":{"test":"test"},"dependencies":{"hosted-git-info":"^2.5.0","semver":"^6.0.0","validate-npm-package-name":"^3.0.0"},"devDependencies":{"standard":"9.0.2","tap":"^10.3.0"},"scripts":{"test":"standard && tap -J --coverage test/*.js"},"repository":{"type":"git","url":"git+https://github.com/zkochan/npm-package-arg.git"},"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"license":"ISC","bugs":{"url":"https://github.com/zkochan/npm-package-arg/issues"},"homepage":"https://github.com/zkochan/npm-package-arg","readmeFilename":"README.md","gitHead":"4be0b127a2f82bc23c64d912e75c685df5b5599d","_id":"@zkochan/npm-package-arg@1.0.2","_nodeVersion":"10.12.0","_npmVersion":"6.9.0","dist":{"shasum":"9495fecbce46c31abe98bac8cb813b7b195b8045","size":5208,"noattachment":false,"key":"/@zkochan/npm-package-arg/-/@zkochan/npm-package-arg-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/@zkochan/npm-package-arg/download/@zkochan/npm-package-arg-1.0.2.tgz"},"maintainers":[{"name":"zkochan","email":"zoltan.kochan+github@gmail.com"}],"_npmUser":{"name":"zkochan","email":"z@kochan.io"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/npm-package-arg_1.0.2_1554054250818_0.21119769479148442"},"_hasShrinkwrap":false,"publish_time":1554054250938,"_cnpm_publish_time":1554054250938},"1.0.1":{"name":"@zkochan/npm-package-arg","version":"1.0.1","description":"Parse the things that can be arguments to `npm install`","main":"npa.js","directories":{"test":"test"},"dependencies":{"hosted-git-info":"^2.5.0","semver":"^5.4.1","validate-npm-package-name":"^3.0.0"},"devDependencies":{"standard":"9.0.2","tap":"^10.3.0"},"scripts":{"test":"standard && tap -J --coverage test/*.js"},"repository":{"type":"git","url":"git+https://github.com/zkochan/npm-package-arg.git"},"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"license":"ISC","bugs":{"url":"https://github.com/zkochan/npm-package-arg/issues"},"homepage":"https://github.com/zkochan/npm-package-arg","readmeFilename":"README.md","gitHead":"d7380ed9eb60e8f1726017188b580c85d9ebfec4","_id":"@zkochan/npm-package-arg@1.0.1","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"zkochan","email":"z@kochan.io"},"dist":{"shasum":"596ebf8a764ccc4f4102504db2ba12faef8c32ff","size":5212,"noattachment":false,"key":"/@zkochan/npm-package-arg/-/@zkochan/npm-package-arg-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@zkochan/npm-package-arg/download/@zkochan/npm-package-arg-1.0.1.tgz"},"maintainers":[{"name":"zkochan","email":"zoltan.kochan+github@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/npm-package-arg_1.0.1_1543440957650_0.9488698647086151"},"_hasShrinkwrap":false,"publish_time":1543440957870,"_cnpm_publish_time":1543440957870},"1.0.0":{"name":"@zkochan/npm-package-arg","version":"1.0.0","description":"Parse the things that can be arguments to `npm install`","main":"npa.js","directories":{"test":"test"},"files":["npa.js"],"dependencies":{"hosted-git-info":"^2.5.0","osenv":"^0.1.4","semver":"^5.4.1","validate-npm-package-name":"^3.0.0"},"devDependencies":{"standard":"9.0.2","tap":"^10.3.0"},"scripts":{"test":"standard && tap -J --coverage test/*.js"},"repository":{"type":"git","url":"git+https://github.com/npm/npm-package-arg.git"},"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"license":"ISC","bugs":{"url":"https://github.com/npm/npm-package-arg/issues"},"homepage":"https://github.com/npm/npm-package-arg","gitHead":"5e77660d9d2d6ad101905dd65b27675352837b45","_id":"@zkochan/npm-package-arg@1.0.0","_npmVersion":"5.5.1","_nodeVersion":"6.11.4","_npmUser":{"name":"zkochan","email":"z@kochan.io"},"dist":{"shasum":"51f8623e4d697bca311007f0180c190aabb6efe7","size":5296,"noattachment":false,"key":"/@zkochan/npm-package-arg/-/@zkochan/npm-package-arg-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@zkochan/npm-package-arg/download/@zkochan/npm-package-arg-1.0.0.tgz"},"maintainers":[{"name":"zkochan","email":"zoltan.kochan+github@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/npm-package-arg-1.0.0.tgz_1511045630710_0.29865804105065763"},"publish_time":1511045631597,"_hasShrinkwrap":false,"_cnpm_publish_time":1511045631597}},"readme":"# @zkochan/npm-package-arg\n\nParses package name and specifier passed to commands like `npm install` or\n`npm cache add`, or as found in `package.json` dependency sections.\n\n## EXAMPLES\n\n```javascript\nvar assert = require(\"assert\")\nvar npa = require(\"@zkochan/npm-package-arg\")\n\n// Pass in the descriptor, and it'll return an object\ntry {\n  var parsed = npa(\"@bar/foo@1.2\")\n} catch (ex) {\n  …\n}\n```\n\n## USING\n\n`var npa = require('@zkochan/npm-package-arg')`\n\n### var result = npa(*arg*[, *where*])\n\n* *arg* - a string that you might pass to `npm install`, like:\n`foo@1.2`, `@bar/foo@1.2`, `foo@user/foo`, `http://x.com/foo.tgz`,\n`git+https://github.com/user/foo`, `bitbucket:user/foo`, `foo.tar.gz`,\n`../foo/bar/` or `bar`.  If the *arg* you provide doesn't have a specifier\npart, eg `foo` then the specifier will default to `latest`.\n* *where* - Optionally the path to resolve file paths relative to. Defaults to `process.cwd()`\n\n**Throws** if the package name is invalid, a dist-tag is invalid or a URL's protocol is not supported.\n\n### var result = npa.resolve(*name*, *spec*[, *where*])\n\n* *name* - The name of the module you want to install. For example: `foo` or `@bar/foo`.\n* *spec* - The specifier indicating where and how you can get this module. Something like:\n`1.2`, `^1.7.17`, `http://x.com/foo.tgz`, `git+https://github.com/user/foo`,\n`bitbucket:user/foo`, `file:foo.tar.gz` or `file:../foo/bar/`.  If not\nincluded then the default is `latest`.\n* *where* - Optionally the path to resolve file paths relative to. Defaults to `process.cwd()`\n\n**Throws** if the package name is invalid, a dist-tag is invalid or a URL's protocol is not supported.\n\n## RESULT OBJECT\n\nThe objects that are returned by @zkochan/npm-package-arg contain the following\nkeys:\n\n* `type` - One of the following strings:\n  * `git` - A git repo\n  * `tag` - A tagged version, like `\"foo@latest\"`\n  * `version` - A specific version number, like `\"foo@1.2.3\"`\n  * `range` - A version range, like `\"foo@2.x\"`\n  * `file` - A local `.tar.gz`, `.tar` or `.tgz` file.\n  * `directory` - A local directory.\n  * `remote` - An http url (presumably to a tgz)\n* `registry` - If true this specifier refers to a resource hosted on a\n  registry.  This is true for `tag`, `version` and `range` types.\n* `name` - If known, the `name` field expected in the resulting pkg.\n* `scope` - If a name is something like `@org/module` then the `scope`\n  field will be set to `@org`.  If it doesn't have a scoped name, then\n  scope is `null`.\n* `escapedName` - A version of `name` escaped to match the npm scoped packages\n  specification. Mostly used when making requests against a registry. When\n  `name` is `null`, `escapedName` will also be `null`.\n* `rawSpec` - The specifier part that was parsed out in calls to `npa(arg)`,\n  or the value of `spec` in calls to `npa.resolve(name, spec).\n* `saveSpec` - The normalized specifier, for saving to package.json files.\n  `null` for registry dependencies.\n* `fetchSpec` - The version of the specifier to be used to fetch this\n  resource.  `null` for shortcuts to hosted git dependencies as there isn't\n  just one URL to try with them.\n* `gitRange` - If set, this is a semver specifier to match against git tags with\n* `gitCommittish` - If set, this is the specific committish to use with a git dependency.\n* `hosted` - If `from === 'hosted'` then this will be a `hosted-git-info`\n  object. This property is not included when serializing the object as\n  JSON.\n* `raw` - The original un-modified string that was provided.  If called as\n  `npa.resolve(name, spec)` then this will be `name + '@' + spec`.\n","_attachments":{},"homepage":"https://github.com/zkochan/npm-package-arg","bugs":{"url":"https://github.com/zkochan/npm-package-arg/issues"},"license":"ISC"}