Prettify JavaScript with js-beautify.
Install the module with: npm install gulp-js-prettify
var gulp = require('gulp');
var prettify = require('gulp-js-prettify');
gulp.task('prettify', function() {
gulp.src('./src/foo.js')
.pipe(prettify({collapseWhitespace: true}))
.pipe(gulp.dest('./src')) // edit in place
});
See the js-beautify docs for options.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality.
Copyright (c) 2014 David McNamara, Jon Schlinkert Licensed under the MIT license.