Detalhes do pacote

testaway

mattmueller140MIT2.0.1

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.

readme (leia-me)

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 file
  • package.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