localinstall

v1.2.0
pack and install your npm package into itself

localinstall

Pack and install your npm package into itself. This is useful if you want to run tests against the distributable that other npm users will be using, and not against the lib / dist in your own build.

Usage

First install this package using npm

$ npm install localinstall --save-dev

Then edit your package.json to include the command before your tests

"scripts": {
  "pretest": "localinstall",
  "test": "your-tests-here"
}

Now, in your tests, you can test your package as if it was installed by an end user.

var mypackage = require('mypackage');
...
npm i localinstall

Metadata

  • ISC
  • Whatever
  • Jesse Jurman
  • released 7/4/2016

Downloads

Maintainers