npm-apis
v1.1.1
Published
The client for api of npmjs
Downloads
23
Readme
npm-apis
The client for api of npmjs
Installation
$ npm i npm-apis
API
getAll
Get all modules of npm
const npmApis = require('npm-apis');
npmApis.getAll().then((modules) => {
// ["lodash"....]
console.info(modules);
});
getUser
Get the user informations
name
The name of user
const npmApis = require('npm-apis');
npmApis.getUser('tree.xie').then((data) => {
// { _id: 'org.couchdb.user:tree.xie',
// email: '[email protected]',
// name: 'tree.xie' }
console.info(data);
});
get
Get the informations of module
name
The name of module
const npmApis = require('npm-apis');
npmApis.get('express').then((data) => {
console.info(data);
});
getDownloads
Get the downloads of module
name
The name of modulestart
The start day, 'YYYY-MM-DD'end
The end day, 'YYYY-MM-DD'
const npmApis = require('npm-apis');
npmApis.getDownloads('lodash', '2017-01-01', '2017-01-02').then((data) => {
// [ { downloads: 398489, day: '2017-01-01' },
// { downloads: 821577, day: '2017-01-02' } ]
console.info(data);
});
getYesterdayDownloads
Get the yesterday's downloads of module
name
The name of module
const npmApis = require('npm-apis');
npmApis.getYesterdayDownloads('lodash').then((count) => {
// 1799544
console.info(count);
});
getTodayUpdates
Get today update modules
const npmApis = require('npm-apis');
npmApis.getTodayUpdates().then((data) => {
console.info(data);
});
getYesterdayUpdates
Get yesterday update modules
const npmApis = require('npm-apis');
npmApis.getYesterdayUpdates().then((data) => {
console.info(data);
});
getDependeds
Get the module depended informations
const npmApis = require('npm-apis');
npmApis.getDependeds().then((data) => {
console.info(data);
});
getScore
Get the score of module (npms.io)
name
The name of module
const npmApis = require('npm-apis');
npmApis.getScore('express').then((data) => {
// { final: 0.966,
// quality: 0.971,
// popularity: 0.954,
// maintenance: 0.974 }
console.info(data);
});
License
MIT