yorkie / reliable-npm

reliable npm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

reliable-npm

NPM version build status Test coverage node version npm download

reliable npm

Installment

$ npm i reliable-npm -g

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)

About

reliable npm

License:MIT License


Languages

Language:JavaScript 85.9%Language:Makefile 14.1%