Skip to content

Commit

Permalink
Add beautification
Browse files Browse the repository at this point in the history
  • Loading branch information
creynders committed Mar 20, 2014
1 parent 4415dc0 commit e175caa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions lib/writeFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ var fs = require( 'fs' );
var yaml = require( 'js-yaml' );
var coffee = require( 'js2coffee' );
var CSON = require( 'cson' );
var beautify = require( 'js-beautify' );

function jsonify( data ){
return JSON.stringify( data, null, 2 );
Expand All @@ -16,9 +17,11 @@ function csonify( plain ){
}

function modularize( plain ){
return 'module.exports = '
return beautify( 'module.exports = '
+ jsonify( plain )
+ ';';
+ ';',
{indent_size : 2}
);
}

function coffize( plain ){
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"js-yaml": "~3.0.1",
"js2coffee": "~0.2.7",
"rimraf": "~2.2.6",
"cson": "^1.4.5"
"cson": "^1.4.5",
"js-beautify": "^1.4.2"
},
"devDependencies": {
"grunt-contrib-jshint": "~0.6.0",
Expand Down

0 comments on commit e175caa

Please sign in to comment.