1.0.4 • Published 9 years ago
mock-npm-install v1.0.4
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 objnodeModulesDir
, defaults to the current dir's node_modules folderpackage
, defaults to generic package.json equivalent js object. any object added here has the generic contentdefault
ed on to it
remove(opts)
name
should correspond to folder removed in node_modulesnodeModulesDir
, defaults to the current dir's node_modules folder
todo
enable async.