Installations
npm install npm-registry-package-info
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
4.2.3
NPM Version
2.14.7
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (92.91%)
Makefile (7.09%)
Developer
kgryte
Download Statistics
Total Downloads
44,400
Last Day
28
Last Week
66
Last Month
192
Last Year
4,022
GitHub Statistics
4 Stars
16 Commits
3 Watching
1 Branches
1 Contributors
Bundle Size
18.01 kB
Minified
5.93 kB
Minified + Gzipped
Package Meta Information
Latest Version
1.0.5
Package Id
npm-registry-package-info@1.0.5
Size
7.38 kB
NPM Version
2.14.7
Node Version
4.2.3
Total Downloads
Cumulative downloads
Total Downloads
44,400
Last day
600%
28
Compared to previous day
Last week
15.8%
66
Compared to previous week
Last month
-47.8%
192
Compared to previous month
Last year
-36%
4,022
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
11
Package Info
Get package information for one or more packages.
Installation
1$ npm install npm-registry-package-info
Usage
1var pkginfo = require( 'npm-registry-package-info' );
pkginfo( opts, clbk )
Get package information for one or more packages.
1var opts = { 2 'packages': [ 3 'dstructs-matrix', 4 'compute-erf', 5 'utils-copy', 6 'unknown_package_name' 7 ] 8}; 9 10pkginfo( opts, clbk ); 11 12function clbk( error, data ) { 13 if ( error ) { 14 throw error; 15 } 16 console.dir( data ); 17 /* 18 { 19 "meta": { 20 "total": 4, 21 "success": 3, 22 "failure": 1 23 }, 24 "data": { 25 "dstructs-matrix": {...}, 26 "compute-erf": {...}, 27 "utils-copy": {...} 28 }, 29 "failures": { 30 "unknown_package_name": "Not Found" 31 } 32 } 33 */ 34}
The function
accepts the following options
:
- packages:
array
of package names (required). - registry: registry. Default:
'registry.npmjs.org'
. - port: registry port. Default:
443
(HTTPS) or80
(HTTP). - protocol: registry protocol. Default:
'https'
. - latest:
boolean
indicating whether to return only the latest package information from a registry.
To query an alternative registry, set the relevant options.
1var opts = { 2 'packages': [ 3 'dstructs-array', 4 'flow-map', 5 'utils-merge2' 6 ], 7 'registry': 'my.favorite.npm/registry', 8 'port': 80, 9 'latest': true, 10 'protocol': 'http' 11}; 12 13pkginfo( opts, clbk );
pkginfo.factory( opts, clbk )
Creates a reusable function
.
1var pkgs = [ 2 'dstructs-matrix', 3 'compute-stdev', 4 'compute-variance' 5]; 6 7var get = pkginfo.factory( {'packages': pkgs}, clbk ); 8 9get(); 10get(); 11get(); 12// ...
The factory method accepts the same options
as pkginfo()
.
Notes
- If the module encounters an application-level
error
(e.g., no network connection, non-existent registry, etc), thaterror
is returned immediately to the providedcallback
. - If the module encounters a downstream
error
(e.g., timeout, reset connection, etc), thaterror
is included in the returned results under thefailures
field.
Examples
1var ls = require( 'npm-list-author-packages' ); 2var pkginfo = require( 'npm-registry-package-info' ); 3 4var opts = { 5 'username': 'kgryte' 6}; 7 8ls( opts, onList ); 9 10function onList( error, list ) { 11 var opts; 12 if ( error ) { 13 throw error; 14 } 15 if ( !list.length ) { 16 return; 17 } 18 opts = { 19 'packages': list 20 }; 21 pkginfo( opts, onInfo ); 22} 23 24function onInfo( error, data ) { 25 if ( error ) { 26 throw error; 27 } 28 console.dir( data ); 29}
To run the example code from the top-level application directory,
1$ DEBUG=* node ./examples/index.js
CLI
Installation
To use the module as a general utility, install the module globally
1$ npm install -g npm-registry-package-info
Usage
1Usage: pkginfo [options] pkg1 pkg2 ... 2 3Options: 4 5 -h, --help Print this message. 6 -V, --version Print the package version. 7 -p, --port port Registry port. Default: 443 (HTTPS) or 80 (HTTP). 8 --registry registry Registry. Default: 'registry.npmjs.org'. 9 --protocol protocol Registry protocol. Default: 'https'. 10 --latest Only return the latest package entry.
Notes
- If a package is successfully resolved, the package info is written to
stdout
. - If a package cannot be resolved due to a downstream
error
(failure), the package (and its associatederror
) is written tosterr
. - Output order is not guaranteed to match input order.
Examples
1$ DEBUG=* pkginfo dstructs-matrix compute-erf utils-copy 2# => {...}
Tests
Unit
This repository uses tape for unit tests. To run the tests, execute the following command in the top-level application directory:
1$ make test
All new feature development should have corresponding unit tests to validate correct functionality.
Test Coverage
This repository uses Istanbul as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:
1$ make test-cov
Istanbul creates a ./reports/coverage
directory. To access an HTML version of the report,
1$ make view-cov
Browser Support
This repository uses Testling for browser testing. To run the tests in a (headless) local web browser, execute the following command in the top-level application directory:
1$ make test-browsers
To view the tests in a local web browser,
1$ make view-browser-tests
License
Copyright
Copyright © 2016. Athan Reines.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/16 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
3
/10
Last Scanned on 2025-01-27
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 MoreOther packages similar to npm-registry-package-info
@types/npm-registry-package-info
TypeScript definitions for npm-registry-package-info
package-fetcher
Get information about an NPM package directly from the registry.
@extra-npm/view
View registry info about a package.
npm-stats-info
This is an npm package to interact with the npm api and npm registry. You can search for npm packages, get details, statistics or downlaod counts of any npm package.