Beautify JavaScript files with gobble and jsbeautifier
npm install gobble-jsbeautifyBeautify JavaScript files with gobble and js-beautify.
First, you need to have gobble installed - see the gobble readme for details. Then,
``bash`
npm i -D gobble-jsbeautify
gobblefile.js
`js`
var gobble = require( 'gobble' );
module.exports = gobble( 'uglycode' ).map( 'jsbeautify', jsBeautifyOptions );
The js-beautify options are as per the documentation.
`js
module.exports = jsbeautify;
function jsbeautify ( code, options ) {
return require( 'js-beautify' ).js_beautify( code, options );
}
jsbeautify.defaults = {
accept: '.js'
};
``
MIT. Copyright 2014 Rich Harris