reliable-npm

0.2.8 • Public • Published

reliable-npm

NPM version build status Test coverage node version npm download

reliable npm

Installment

$ npm i reliable-npm --save

Usage

 
// normal usage
 
var npm = require('reliable-npm');
 
npm.install({
  cwd: '.',
}, function(error, data) {
  if (error) {
    console.log(error);
    return;
  }
  console.log(data);
});
 
// use in co, for a yield syntax instead of callback function implement
 
try {
  var data = yield npm.install({
    cwd: '.',
  });
  console.log(data);
} catch(e) {
  // e maybe `null`
  console.log(e);
}
 
// use as a promise
 
npm.install({
  cwd: '.'
})
.then(function(data) {
  console.log(data);
})
.catch(function(e) {
  console.log(e);
});
 
// for a custom config
 
var NPM = require('reliable-npm').NPM;
var npm = new NPM({
  registry: 'https://other.npmjs.org'
});

License

The MIT License (MIT)

Readme

Keywords

Package Sidebar

Install

npm i reliable-npm

Weekly Downloads

4

Version

0.2.8

License

MIT

Last publish

Collaborators

  • brunoyang
  • xudafeng
  • ziczhu