/ student-intifada / node_modules / npm-package-arg /

[ICO]NameLast modifiedSizeDescription
[PARENTDIR]Parent Directory  -  
[DIR]lib/a year ago -  
[   ]LICENSEa year ago739  
[TXT]README.mda year ago4.3K595aea1 more query options + view options [كارل مبارك]
[   ]package.jsona year ago1.5Kafd0ccc remove unused [كارل مبارك]
README.md

npm-package-arg

Build Status

Parses package name and specifier passed to commands like npm install or npm cache add, or as found in package.json dependency sections.

EXAMPLES

var assert = require("assert")
var npa = require("npm-package-arg")

// Pass in the descriptor, and it'll return an object
try {
  var parsed = npa("@bar/foo@1.2")
} catch (ex) {
  …
}

USING

var npa = require('npm-package-arg')

var result = npa(arg[, where])

Throws if the package name is invalid, a dist-tag is invalid or a URL's protocol is not supported.

var result = npa.resolve(name, spec[, where])

Throws if the package name is invalid, a dist-tag is invalid or a URL's protocol is not supported.

var purl = npa.toPurl(arg, reg)

Returns the purl (package URL) form of the given package name/spec.

Throws if the package name is invalid, or the supplied arg can't be resolved to a purl.

RESULT OBJECT

The objects that are returned by npm-package-arg contain the following keys:

Apache/2.4.38 (Debian) Server at www.karls.computer Port 80