Complexity Score
Low
Open Issues
9
Dependent Projects
301
Weekly Downloadsglobal
1,160
License
- MIT
- Yesattribution
- Permissivelinking
- Permissivedistribution
- Permissivemodification
- Nopatent grant
- Yesprivate use
- Permissivesublicensing
- Notrademark grant
Downloads
Readme
pkg-ok
pkg-ok
checks paths and scripts defined in package.json
before you publish 👌
- Ensures paths defined in
main
,bin
,module
,types
,typings
,es2015
,browser
, andexports
exist - Ensures paths defined in
main
,bin
, andbrowser
are relative - Ensures
bin
scripts 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 blocked
CLI
Check the package.json
in the current directory.
pkg-ok
Check the package.json
in a specific directory.
pkg-ok some/directory
Check additional package.json
fields or bin files.
pkg-ok --field someField --bin script.sh
API
const pkgDirectory = __dirname;
pkgOk(pkgDirectory, {
fields: ['someAdditonalField'],
bin: ['someAdditionalScript.sh'],
});
License
MIT
Dependencies
Loading dependencies...
CVE IssuesActive
0
Scorecards Score
No Data
Test Coverage
No Data
Follows Semver
Yes
Github Stars
236
Dependenciestotal
17
DependenciesOutdated
10
DependenciesDeprecated
0
Threat Modelling
No
Repo Audits
No
Learn how to distribute pkg-ok in your own private NPM registry
$npm config set registry
https://npm.cloudsmith.com/owner/repo
/Processing...
✓Done
$npm install pkg-ok
/Processing...
✓Done
14 Releases
NPM on Cloudsmith