remove-local-package-directories

0.0.3 • Public • Published

Remove local directory packages

Build Status

Based on 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. There is a caveat though, as npm@3 preinstall is broken. 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 <path>: the path were to run the tool, defaults to current dir.

Programmatically

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

// package.json
{
  // ...
  "scripts": {
    "preinstall": "rm-local-modules"
  },
  "dependencies": {
    "local": "file:local",
    "sublocal": "file:sub/local"
  },
  "devDependencies": {
    "rm-local-modules": "^0.0.0"
  }
}

Readme

Keywords

Package Sidebar

Install

npm i remove-local-package-directories

Weekly Downloads

0

Version

0.0.3

License

MIT

Unpacked Size

6.04 kB

Total Files

8

Last publish

Collaborators

  • ovissse