Gathering detailed insights and metrics for npm-api
Gathering detailed insights and metrics for npm-api
Gathering detailed insights and metrics for npm-api
Gathering detailed insights and metrics for npm-api
webpack-chain
[![NPM version][npm-image]][npm-url] [![NPM downloads][npm-downloads]][npm-url] [![Build Status][travis-image]][travis-url]
npm-check
Check for outdated, incorrect, and unused dependencies.
@modern-js/codesmith-api-npm
codesmith npm api
npm-audit-report
Given a response from the npm security api, render it into a variety of security reports
npm install npm-api
Typescript
Module System
Min. Node Version
Node Version
NPM Version
95
Supply Chain
95.9
Quality
74.3
Maintenance
50
Vulnerability
99.6
License
JavaScript (100%)
Total Downloads
56,628,549
Last Day
78,897
Last Week
367,887
Last Month
1,408,877
Last Year
15,414,435
MIT License
108 Stars
124 Commits
18 Forks
4 Watchers
1 Branches
6 Contributors
Updated on Apr 03, 2025
Latest Version
1.0.1
Package Id
npm-api@1.0.1
Size
7.98 kB
NPM Version
7.3.0
Node Version
15.5.1
Published on
Jan 20, 2021
Cumulative downloads
Total Downloads
Last Day
28%
78,897
Compared to previous day
Last Week
29.4%
367,887
Compared to previous week
Last Month
1.2%
1,408,877
Compared to previous month
Last Year
76.1%
15,414,435
Compared to previous year
2
Node.js library for getting info from NPM’s API
Please consider following this project's author, Brian Woodward, and consider starring the project to show your :heart: and support.
Install with npm:
1$ npm install --save npm-api
1var NpmApi = require('npm-api');
NpmApi constructor. Create an instance to work with maintainer and repository information.
Example
1let npm = new NpmApi();
Create a new instance of View
or get an existing instance to work with npm couchdb views.
Params
name
{String}: Name of the couchdb view to work with.returns
{Object} View
: instanceExample
1var view = npm.view('byUser');
Create a new instance of List
or get an existing instance to work with npm couchdb list.
Params
name
{String}: Name of the couchdb list to work with.view
{String|Object}: Name or instance of a view
to work with.returns
{Object} List
: instanceExample
1var list = npm.list('sortCount', 'byUser');
Create an instance of a repo
to work with.
Params
name
{String}: Name of the repo as it's published to npm.returns
{Object}: Instance of a Repo
model to work with.Example
1var repo = npm.repo('micromatch');
Create an instance of a maintainer
to work with.
Params
name
{String}: Npm username of the maintainer.returns
{Object}: Instance of a Maintainer
model to work with.Example
1var maintainer = npm.maintainer('doowb');
Base model to include common plugins.
Params
store
{Object}: Cache store instance to use.Maintainer constructor. Create an instance of an npm maintainer by maintainer name.
Params
name
{String}: Name of the npm maintainer to get information about.Example
1const maintainer = new Maintainer('doowb');
Get the repositories owned by this maintainer.
returns
{Promise}: Returns array of repository names when promise resolves.Example
1maintainer.repos() 2 .then(function(repos) { 3 console.log(repos); 4 }, function(err) { 5 console.error(err); 6 });
Repo constructor. Create an instance of an npm repo by repo name.
Params
name
{String}: Name of the npm repo to get information about.Example
1const repo = new Repo('micromatch');
Get the repo's published package.json.
returns
{Promise}: Returns the package.json object when promise resolves.Example
1repo.package() 2 .then(function(pkg) { 3 console.log(pkg); 4 }, function(err) { 5 console.error(err); 6 });
Get the repo's published package.json value for the specified version.
Params
version
{String}: Specific version to retrieve.returns
{Promise}: Returns the package.json object for the specified version when promise resolves.Example
1repo.version('0.2.0') 2 .then(function(pkg) { 3 console.log(pkg); 4 }, function(err) { 5 console.error(err); 6 });
Get the repo's dependencies for the specified version.
Params
version
{String}: Specific version to retrieve. Defaults to latest
.returns
{Promise}: Returns the dependencies object for the specified version when promise resolves.Example
1repo.dependencies() 2 .then(function(dependencies) { 3 console.log(dependencies); 4 }, function(err) { 5 console.error(err); 6 });
Get the repo's devDependencies for the specified version.
Params
version
{String}: Specific version to retrieve. Defaults to latest
.returns
{Promise}: Returns the devDependencies object for the specified version when promise resolves.Example
1repo.devDependencies() 2 .then(function(devDependencies) { 3 console.log(devDependencies); 4 }, function(err) { 5 console.error(err); 6 });
Get the specified property from the repo's package.json for the specified version.
Params
prop
{String}: Name of the property to get.version
{String}: Specific version to retrieve. Defaults to latest
.returns
{Promise}: Returns the property for the specified version when promise resolves.Example
1repo.prop('author') 2 .then(function(author) { 3 console.log(author); 4 }, function(err) { 5 console.error(err); 6 });
View constructor. Create an instance of a view associated with a couchdb view in the npm registry.
Params
name
{String}: Name of couchdb view to use.returns
{Object}: instance of View
Example
1const view = new View('dependedUpon');
Query the couchdb view with the provided parameters.
Params
params
{Object}: URL query parameters to pass along to the couchdb view.returns
{Promise}: Results of the query when promise is resolved.Example
1let results = await view.query({ 2 group_level: 2, 3 startkey: JSON.stringify(['micromatch']), 4 endkey: JSON.stringify(['micromatch', {}]) 5});
Query the couchdb view with the provided parameters and return a stream of results.
Params
params
{Object}: URL query parameters to pass along to the couchdb view.returns
{Stream}: Streaming results of the query.Example
1view.stream({ 2 group_level: 2, 3 startkey: JSON.stringify(['micromatch']), 4 endkey: JSON.stringify(['micromatch', {}]) 5}) 6.on('data', (data) => { 7 console.log(data); 8});
Build a formatted url with the provided parameters.
Params
query
{Object}: URL query parameters.returns
{String}: formatted url stringList constructor. Create an instance of a list associated with a couchdb list in the npm registry.
Params
name
{String}: Name of couchdb list to use.view
{Object}: Instance of a View to use with the list.returns
{Object}: instance of List
Example
1let list = new List('dependedUpon', view);
Query the couchdb list with the provided parameters.
Params
params
{Object}: URL query parameters to pass along to the couchdb list.returns
{Promise}: Results of the query when promise is resolved.Example
1let results = await list.query({ key: JSON.stringify(['micromatch']) })
Build a formatted url with the provided parameters.
Params
query
{Object}: URL query parameters.returns
{String}: formatted url stringPull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Please read the contributing guide for advice on opening issues, pull requests, and coding standards.
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
1$ npm install && npm test
(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)
To generate the readme, run the following command:
1$ npm install -g verbose/verb#dev verb-generate-readme && verb
You might also be interested in these projects:
Commits | Contributor |
---|---|
115 | doowb |
1 | 0xflotus |
1 | Hypnosphi |
1 | NachmanBerkowitz |
Brian Woodward
Copyright © 2021, Brian Woodward. Released under the MIT License.
This file was generated by verb-generate-readme, v0.8.0, on January 20, 2021.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 5/25 approved changesets -- score normalized to 2
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
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-05-05
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