testaway
v2.0.1
Published
Testaway is a sanity check that your module will work as expected when it's installed. This module exists to prevent you from publishing broken packages to NPM.
Downloads
167
Readme
Testaway
Testaway is a sanity check that your module will work as expected when it's installed. This module exists to prevent you from publishing broken packages to NPM.
Testaway catches issues like:
package.main
is pointing to the wrong filepackage.files
don't have all the necessary files- my distribute is using the wrong syntax
- using my library depends on my library being in node_modules
Install
npm install testaway
Example
const os = require('os')
const path = require('path')
const pkgdir = require('pkg-dir')
const tmpdir = path.join(os.tmpdir(), 'duo')
const duo = pkgdir.sync(__dirname)
await testaway(tmpdir, duo, 'preact')
API
testaway(toDir: string, ...packages: []string): Promise<void>
Install packages
to toDir
. If the package is local, testaway will pack it using the same algorithm that NPM uses.
License
MIT