Need help with pkg-ok?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

typicode
219 Stars 10 Forks MIT License 56 Commits 13 Opened issues

Description

👌 Checks paths and scripts defined in package.json before you publish

Services available

!
?

Need anything else?

Contributors list

# 340
JavaScr...
process...
Git
exec
53 commits
# 31,131
datastr...
vscode
Less
mobile-...
1 commit
# 29,883
TypeScr...
reselec...
React
Electro...
1 commit

pkg-ok Build Status npm

pkg-ok
checks paths and scripts defined in
package.json
before you publish 👌
  • Ensures paths defined in
    main
    ,
    bin
    ,
    module
    ,
    types
    ,
    typings
    ,
    es2015
    and
    browser
    exist
  • 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 

Options

pkg-ok
can be configured to check additional
package.json
fields or bin files
pkgOk --field someField --bin script.sh

API

const pkgDirectory = __dirname

pkgOk(pkgDirectory, { fields: ['someAdditonalField'], bin: ['someAdditionalScript.sh'] })

License

MIT

Patreon - Supporters ✨

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.