1.1.1 • Published 7 years ago

npm-apis v1.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

npm-apis

Build Status Coverage Status npm Github Releases

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: 'vicansocanbico@gmail.com',
  // 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 module

  • start 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

1.1.1

7 years ago

1.1.0

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago