0.2.1 • Published 3 months ago

@mapbox/duplicate-module-test v0.2.1

Weekly downloads
175
License
ISC
Repository
-
Last release
3 months ago

Duplicate module test

A small command line utility used to test for duplicate installs of a module or list of modules using NPM's npm ls command output. Particularly helpful for node addons where you want to be :100: sure there is only a single version of a binary installed before executing your code. More background as to why avoiding duplicate binaries is important here.

Usage

The primary usage is via the CLI command, duplicate-module-test, which assumes every argument passed in is the name of a module in the node_modules tree to test.

Example command

duplicate-module-test @mapbox/vtquery mapnik something-else

Output will look something like:

Checking for duplicate modules ...

✔ @mapbox/vtquery has only one version
✗ found 2 versions of mapnik
✔ something-else has only one version

Pretest

The command is particularly helpful added as a pretest command in your package.json document. This can be run in tandem with other pretest commands, like linters.

{
  "scripts": {
    "test": "node tests.js",
    "pretest": "duplicate-module-test module-one module-two && eslint index.js"
  }
}
0.2.1

3 months ago

0.2.0

4 years ago

0.1.0

6 years ago

0.1.0-alpha2

6 years ago

0.1.0-alpha

6 years ago