pkg-ok
Checks package.json main and bin paths
Last updated a year ago by typicode .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install pkg-ok 
SYNC missed versions from official npm registry.

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

Current Tags

  • 2.3.1                                ...           latest (a year ago)

8 Versions

  • 2.3.1                                ...           a year ago
  • 2.3.0                                ...           a year ago
  • 2.2.0                                ...           a year ago
  • 2.1.0                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 11
This Month 34
Last Day 7
Last Week 10
Last Month 47
Dependencies (3)
Dev Dependencies (9)

Copyright 2014 - 2016 © taobao.org |