NPM.restrict()

Restrict access to a package published on NPM.

Usage

Hover over inputs/exits for more info.

var NPM = require('machinepack-npm');


// Restrict access to a package published on NPM.

NPM.restrict({

packageName: '@mattmueller/cheerio',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// You can't change the access level of an unscoped package (e.g. "lodash" is unscoped, whereas "@jdalton/lodash" is scoped.)

unscopedPackage: function () {

 

},

// OK.

success: function () {

 

},

});

Inputs

packageName required

The name of the NPM package to retrict access to.

'@mattmueller/cheerio'

Exits

error

An unexpected error occurred.

unscopedPackage

You can't change the access level of an unscoped package (e.g. "lodash" is unscoped, whereas "@jdalton/lodash" is scoped.)

success

OK.