Gathering detailed insights and metrics for @zkochan/npm-package-arg
Gathering detailed insights and metrics for @zkochan/npm-package-arg
Gathering detailed insights and metrics for @zkochan/npm-package-arg
Gathering detailed insights and metrics for @zkochan/npm-package-arg
npm install @zkochan/npm-package-arg
Typescript
Module System
Min. Node Version
Node Version
NPM Version
72.5
Supply Chain
93
Quality
75.5
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
854,406
Last Day
31
Last Week
898
Last Month
2,854
Last Year
97,751
1 Stars
110 Commits
2 Watching
5 Branches
37 Contributors
Minified
Minified + Gzipped
Latest Version
2.0.1
Package Id
@zkochan/npm-package-arg@2.0.1
Size
5.12 kB
NPM Version
6.14.11
Node Version
12.19.0
Publised On
24 Mar 2021
Cumulative downloads
Total Downloads
Last day
-36.7%
31
Compared to previous day
Last week
54.8%
898
Compared to previous week
Last month
-28.1%
2,854
Compared to previous month
Last year
-66.5%
97,751
Compared to previous year
3
Parses package name and specifier passed to commands like npm install
or
npm cache add
, or as found in package.json
dependency sections.
1var assert = require("assert") 2var npa = require("@zkochan/npm-package-arg") 3 4// Pass in the descriptor, and it'll return an object 5try { 6 var parsed = npa("@bar/foo@1.2") 7} catch (ex) { 8 … 9}
var npa = require('@zkochan/npm-package-arg')
npm install
, like:
foo@1.2
, @bar/foo@1.2
, foo@user/foo
, http://x.com/foo.tgz
,
git+https://github.com/user/foo
, bitbucket:user/foo
, foo.tar.gz
,
../foo/bar/
or bar
. If the arg you provide doesn't have a specifier
part, eg foo
then the specifier will default to latest
.process.cwd()
Throws if the package name is invalid, a dist-tag is invalid or a URL's protocol is not supported.
foo
or @bar/foo
.1.2
, ^1.7.17
, http://x.com/foo.tgz
, git+https://github.com/user/foo
,
bitbucket:user/foo
, file:foo.tar.gz
or file:../foo/bar/
. If not
included then the default is latest
.process.cwd()
Throws if the package name is invalid, a dist-tag is invalid or a URL's protocol is not supported.
The objects that are returned by @zkochan/npm-package-arg contain the following keys:
type
- One of the following strings:
git
- A git repotag
- A tagged version, like "foo@latest"
version
- A specific version number, like "foo@1.2.3"
range
- A version range, like "foo@2.x"
file
- A local .tar.gz
, .tar
or .tgz
file.directory
- A local directory.remote
- An http url (presumably to a tgz)registry
- If true this specifier refers to a resource hosted on a
registry. This is true for tag
, version
and range
types.name
- If known, the name
field expected in the resulting pkg.scope
- If a name is something like @org/module
then the scope
field will be set to @org
. If it doesn't have a scoped name, then
scope is null
.escapedName
- A version of name
escaped to match the npm scoped packages
specification. Mostly used when making requests against a registry. When
name
is null
, escapedName
will also be null
.rawSpec
- The specifier part that was parsed out in calls to npa(arg)
,
or the value of spec
in calls to `npa.resolve(name, spec).saveSpec
- The normalized specifier, for saving to package.json files.
null
for registry dependencies.fetchSpec
- The version of the specifier to be used to fetch this
resource. null
for shortcuts to hosted git dependencies as there isn't
just one URL to try with them.gitRange
- If set, this is a semver specifier to match against git tags withgitCommittish
- If set, this is the specific committish to use with a git dependency.hosted
- If from === 'hosted'
then this will be a hosted-git-info
object. This property is not included when serializing the object as
JSON.raw
- The original un-modified string that was provided. If called as
npa.resolve(name, spec)
then this will be name + '@' + spec
.No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
11 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More