gulp-nice-package
Opinionated package.json validator. Uses package.json-validator under the covers
Install
npm install gulp-nice-package --save-dev
Usage
// gulpfile.jsvar gulp = ;var validate = ; gulp;
Options
Any options defined are simply passed along to package.json-validator
// gulpfile.jsvar gulp = ;var validate = ; gulp;
Failing your build
The below will both print errors to the console and exit the gulp process with an appropriate error code for properly failing builds.
var gulp = validate = mapstream = ; process; gulp;
I know, it seems a bit terse. The reasoning is, you may want to pipe other transforms onto the stream and, if an error is thrown, the pipe will cease and you have no way to continue. A valid use case may be to actually fix the the package.json file programmatically if it's invalid, e.g. with gulp-shrinkwrap.