publint
Lint packaging errors. Ensure compatibility across environments.
Try it online
This package contains a CLI and API to lint packages locally. The package to be linted must exist and be built locally for the lint to succeed. To test other npm packages, try https://publint.dev.
Usage
CLI
$ npx publint
$ npx publint ./node_modules/some-lib
$ npx publint deps
Use npx publint --help
for more information.
API
import { publint } from 'publint'
const messages = await publint({
pkgDir: './path/to/package',
vfs: createCustomVfsObj(),
level: 'warning'
})
console.log(messages)
Extra utilities are exported under publint/utils
:
import { printMessage } from 'publint/utils'
for (const message of messages) {
printMessage(message)
}
License
MIT