Fetch the information for packages inside the npm registry
- Install:
npm install --save getpackages
- Module:
require('getpackages')
This package is published with the following editions:
getpackages
aliasesgetpackages/index.js
which uses Editions to automatically select the correct edition for the consumers environmentgetpackages/source/index.coffee
is Source + CoffeeScript + Requiregetpackages/esnext/index.js
is CoffeeScript Compiled + ESNext + Requiregetpackages/es2015/index.js
is CoffeeScript Compiled + ES2015 + Require
Older environments may need Babel's Polyfill or something similar.
// Create our instance
var getter = require('getpackages').create({
onlyLatest: true, // optional (defaults to `true`), accepts a boolean, `true` will fetch information only for the latest version, `false` wil fetch information for all versions
log: console.log // optional (defaults to `null`), accepts a function that accepts the arguments: level, message...
});
// Fetch the data on these github repositories
getter.fetchPackagesByNames(['bevry/getpackages'], function(err, entries){
console.log(err, entries);
// Fetch all the repo data on these github users/organisations
getter.fetchPackagesByKeyword('docpad-plugin', function(err, entries){
console.log(err, entries);
// Get the combined listing
console.log(getter.getEntries());
});
});
- When
onlyLatest
istrue
, entry data is retrieved from: http://registry.npmjs.org/#{packageName}/latest - When
onlyLatest
isfalse
, entry data is retrieved from: http://registry.npmjs.org/#{packageName}
Discover how you can contribute by heading on over to the CONTRIBUTING.md
file.
Discover the release history by heading on over to the HISTORY.md
file.
These amazing people are maintaining this project:
No sponsors yet! Will you be the first?
These amazing people have contributed code to this project:
Discover how you can contribute by heading on over to the CONTRIBUTING.md
file.
Unless stated otherwise all works are:
- Copyright © 2013+ Bevry Pty Ltd
and licensed under: