https://github.com/cdaringe/mock-npm-install
Generates a mock package into node_modules/
https://github.com/cdaringe/mock-npm-install
Last synced: about 1 month ago
JSON representation
Generates a mock package into node_modules/
- Host: GitHub
- URL: https://github.com/cdaringe/mock-npm-install
- Owner: cdaringe
- License: mit
- Created: 2015-10-18T00:39:06.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T17:43:13.000Z (over 2 years ago)
- Last Synced: 2025-10-20T01:22:08.100Z (8 months ago)
- Language: JavaScript
- Size: 374 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[ ](https://codeship.com/projects/109534)
See formal docs over @ http://cdaringe.github.io/mock-npm-install/index.html
# mock-npm-install
[](https://greenkeeper.io/)
Install or remove a dummy package into a node_modules/ folder. All actions are synchronous, at the moment!
## usage
```js
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 `default`ed 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.