3.0.0 • Published 4 years ago
pkg-ok v3.0.0
pkg-ok

pkg-okchecks paths and scripts defined inpackage.jsonbefore you publish 👌
- Ensures paths defined in
main,bin,module,types,typings,es2015,browser, andexportsexist - Ensures paths defined in
main,bin, andbrowserare relative - Ensures
binscripts use cross-platform line endings
Usage
npm install pkg-ok --save-dev// package.json
{
"main": "oops_this_file_doesnt_exist.js",
"scripts": {
"prepublishOnly": "... && pkg-ok"
}
}npm publish
# Error!
# Since main file doesn't exist, publish is blockedCLI
Check the package.json in the current directory.
pkg-okCheck the package.json in a specific directory.
pkg-ok some/directoryCheck additional package.json fields or bin files.
pkg-ok --field someField --bin script.shAPI
const pkgDirectory = __dirname;
pkgOk(pkgDirectory, {
fields: ['someAdditonalField'],
bin: ['someAdditionalScript.sh'],
});License
MIT
3.0.0-next.2
4 years ago
3.0.0-next.4
4 years ago
3.0.0-next.3
4 years ago
3.0.0
4 years ago
3.0.0-next.6
4 years ago
3.0.0-next.5
4 years ago
2.3.1
7 years ago
2.3.0
7 years ago
2.2.0
8 years ago
2.1.0
8 years ago
2.0.0
8 years ago
1.1.0
9 years ago
1.0.1
9 years ago
1.0.0
9 years ago