{"name":"realize-package-specifier","version":"2.2.0","author":{"url":"http://re-becca.org","name":"Rebecca Turner","email":"me@re-becca.org"},"license":"ISC","_id":"realize-package-specifier@2.2.0","maintainers":[{"name":"iarna","email":"me@re-becca.org"}],"homepage":"https://github.com/npm/realize-package-specifier","bugs":{"url":"https://github.com/npm/realize-package-specifier/issues"},"dist":{"shasum":"95278b6021a39158f284e15756e827fc2998ed9c","tarball":"http://registry-npm.ywwl.com/realize-package-specifier/download/realize-package-specifier-2.2.0.tgz","integrity":"sha512-dX2a39dzdKgxy5TyZtde37aLxNxsQWOYW9uEQB9OcPe0KwEkqEVG9nTH94L6z753y3RcJS80sXpeC0pRXUvadQ==","signatures":[{"sig":"MEUCIQDJaItZGXtahj/8In0PxlwoW63Th2vDx9XORxYdlo8NwgIgGvysnfy9pL2lGYb8z/EVdbhF6DG/gEfwzDf+GqtsMDE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"size":4550,"noattachment":false,"key":"/realize-package-specifier/-/realize-package-specifier-2.2.0.tgz"},"main":"index.js","_from":".","_shasum":"95278b6021a39158f284e15756e827fc2998ed9c","gitHead":"8810720d191647f06a505fc5da8d0634a21526b8","scripts":{"test":"tap test/*.js"},"_npmUser":{"name":"iarna","email":"me@re-becca.org"},"deprecated":"This package is no longer supported.","repository":{"url":"https://github.com/npm/realize-package-specifier.git","type":"git"},"_npmVersion":"2.4.1","description":"Like npm-package-arg, but more so, producing full file paths and differentiating local tar and directory sources.","directories":{},"_nodeVersion":"1.0.4","dependencies":{"dezalgo":"^1.0.1","npm-package-arg":"^3.1.0"},"devDependencies":{"tap":"^0.4.12","require-inject":"^1.1.0"},"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":1422218546854,"_cnpm_publish_time":1422218546854,"dist-tags":{"latest":"3.0.3"}}