{"name":"realize-package-specifier","version":"3.0.2","author":{"url":"http://re-becca.org","name":"Rebecca Turner","email":"me@re-becca.org"},"license":"ISC","_id":"realize-package-specifier@3.0.2","maintainers":[{"name":"iarna","email":"me@re-becca.org"},{"name":"othiym23","email":"ogd@aoaioxxysz.net"},{"name":"zkat","email":"kat@sykosomatic.org"}],"homepage":"https://github.com/npm/realize-package-specifier","bugs":{"url":"https://github.com/npm/realize-package-specifier/issues"},"dist":{"shasum":"e4ee03e73f47246e8e704560c5461242b9f37eed","tarball":"http://registry-npm.ywwl.com/realize-package-specifier/download/realize-package-specifier-3.0.2.tgz","integrity":"sha512-ERXwVpxjKVoV1Hln0hF0NoXHHMaAo8weoZ8qDYykiOWJfEOI2QxIVTe6q0XeN26iANwfJVQlbD/qbf7BSrHgTQ==","signatures":[{"sig":"MEUCICV/Pdehusg2F9iqCMqfPtR5YI6NISGmiLtJI2zZzgpPAiEA0u/rifdnCoxAO1UFeJUnz5z9T7jR68PQEyAEUEUvev8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"size":5049,"noattachment":false,"key":"/realize-package-specifier/-/realize-package-specifier-3.0.2.tgz"},"main":"index.js","_from":".","_shasum":"e4ee03e73f47246e8e704560c5461242b9f37eed","gitHead":"bae72e7f28ed3cabe42df950ec316669a80baff3","scripts":{"test":"tap test/*.js"},"_npmUser":{"name":"zkat","email":"kat@sykosomatic.org"},"deprecated":"This package is no longer supported.","repository":{"url":"git+https://github.com/npm/realize-package-specifier.git","type":"git"},"_npmVersion":"3.8.7","description":"Like npm-package-arg, but more so, producing full file paths and differentiating local tar and directory sources.","directories":{},"_nodeVersion":"5.6.0","dependencies":{"dezalgo":"^1.0.1","npm-package-arg":"^4.1.1"},"devDependencies":{"tap":"^5.7.1","require-inject":"^1.1.0"},"_npmOperationalInternal":{"tmp":"tmp/realize-package-specifier-3.0.2.tgz_1461111138611_0.4448253330774605","host":"packages-12-west.internal.npmjs.com"},"readme":"realize-package-specifier\n-------------------------\n\nParse a package specifier, peeking at the disk to differentiate between\nlocal tarballs, directories and named modules.  This implements the logic\nused by `npm install` and `npm cache` to determine where to get packages\nfrom.\n\n```javascript\nvar realizePackageSpecifier = require(\"realize-package-specifier\")\nrealizePackageSpecifier(\"foo.tar.gz\", \".\", function (err, package) {\n    …\n})\n```\n\n## Using\n\n* realizePackageSpecifier(*spec*, [*where*,] *callback*)\n\nParses *spec* using `npm-package-arg` and then uses stat to check to see if\nit refers to a local tarball or package directory.  Stats are done relative\nto *where*.  If it does then the local module is loaded.  If it doesn't then\ntarget is left as a remote package specifier.  Package directories are\nrecognized by the presence of a package.json in them.\n\n*spec* -- a package specifier, like: `foo@1.2`, or `foo@user/foo`, or\n`http://x.com/foo.tgz`, or `git+https://github.com/user/foo`\n\n*where* (optional, default: .) -- The directory in which we should look for\nlocal tarballs or package directories.\n\n*callback* function(*err*, *result*) -- Called once we've determined what\nkind of specifier this is.  The *result* object will be very like the one\nreturned by `npm-package-arg` except with three differences: 1) There's a\nnew type of `directory`.  2) The `local` type only refers to tarballs.  2)\nFor all `local` and `directory` type results spec will contain the full path of\nthe local package.\n\n## Result Object\n\nThe full definition of the result object is:\n\n* `name` - If known, the `name` field expected in the resulting pkg.\n* `type` - One of the following strings:\n  * `git` - A git repo\n  * `hosted` - A hosted project, from github, bitbucket or gitlab. Originally\n    either a full url pointing at one of these services or a shorthand like\n    `user/project` or `github:user/project` for github or `bitbucket:user/project`\n    for bitbucket.\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  * `local` - A local file path\n  * `directory` - A local package directory\n  * `remote` - An http url (presumably to a tgz)\n* `spec` - The \"thing\".  URL, the range, git repo, etc.\n* `hosted` - If type=hosted this will be an object with the following keys:\n  * `type` - github, bitbucket or gitlab\n  * `ssh` - The ssh path for this git repo\n  * `sshurl` - The ssh URL for this git repo\n  * `https` - The HTTPS URL for this git repo\n  * `directUrl` - The URL for the package.json in this git repo\n* `raw` - The original un-modified string that was provided.\n* `rawSpec` - The part after the `name@...`, as it was originally\n  provided.\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\n","publish_time":1461111138991,"_cnpm_publish_time":1461111138991,"dist-tags":{"latest":"3.0.3"}}