Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arnaudrinquin/rm-local-modules
Removes your locally installed modules
https://github.com/arnaudrinquin/rm-local-modules
Last synced: 2 months ago
JSON representation
Removes your locally installed modules
- Host: GitHub
- URL: https://github.com/arnaudrinquin/rm-local-modules
- Owner: ArnaudRinquin
- Created: 2016-05-08T17:03:30.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-12-15T15:47:08.000Z (about 8 years ago)
- Last Synced: 2024-10-18T19:44:16.920Z (3 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/rm-local-modules
- Size: 3.91 KB
- Stars: 21
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rm-local-modules
[![Build Status](https://travis-ci.org/ArnaudRinquin/rm-local-modules.svg?branch=master)](https://travis-ci.org/ArnaudRinquin/rm-local-modules)
Removes your locally installed modules.
Use case:
* Make sure you always have latest version of your locally installed modules using it in `preinstall`. [Example](https://github.com/ArnaudRinquin/local_modules_poc). There is a caveat though, as [npm@3 preinstall is broken](https://github.com/npm/npm/issues/10379). Works fine with npm@2
## CLI Options
`-verbose, -v`: outputs which modules where detected and if they were successfully removed:
> ```
> Tried to remove 2 local module(s):
> local ✔
> sublocal ✔
> ````-dir, -d `: the path were to run the tool, defaults to current dir.
## Programmatically
```js
var rmLocalModules = require('.');var opts = {
log: console.log.bind(console), // optional
dir: '.', // mandatory
};rmLocalModules(opts).then(function(results){
// results is like [
// {name: 'local', success: true},
// {name: 'local', success: false, error: ... }
// ]
});
```## Example
```js
// package.json
{
// ...
"scripts": {
"preinstall": "rm-local-modules"
},
"dependencies": {
"local": "file:local",
"sublocal": "file:sub/local"
},
"devDependencies": {
"rm-local-modules": "^0.0.0"
}
}
```