1.0.4 • Published 9 years ago

mock-npm-install v1.0.4

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

Codeship Status for cdaringe/mock-npm-install

See formal docs over @ http://cdaringe.github.io/mock-npm-install/index.html

mock-npm-install

Install or remove a dummy package into a node_modules/ folder. All actions are synchronous, at the moment!

usage

var mockPackage = require('mock-npm-install');
var mock1 = mockPackage.install(); //=> node_modules/mock_package_1 now exists w/ package.json
mockPackage.remove({ name: mock1.name }); //=> removes the pkg folder

api

  • install(opts), returns package.json js obj
    • nodeModulesDir, defaults to the current dir's node_modules folder
    • package, defaults to generic package.json equivalent js object. any object added here has the generic content defaulted on to it
  • remove(opts)
    • name should correspond to folder removed in node_modules
    • nodeModulesDir, defaults to the current dir's node_modules folder

todo

enable async.