Skip to content
/ pkg-ok Public
forked from abraham/pkg-ok

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

License

Notifications You must be signed in to change notification settings

axaq/pkg-ok

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 ✨

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%