Hjson plugin for gulp, converts from and to JSON.
Hjson, the Human JSON. A configuration file format that caters to humans and helps reduce the errors they make.
It supports #
, //
and /**/
style comments as well as avoiding trailing/missing comma and other mistakes. For details and syntax see hjson.org.
First, install gulp-hjson
as a development dependency:
npm install --save-dev gulp-hjson
Then, add it to your gulpfile.js
:
var Hjson = require('gulp-hjson');
gulp.task('json', function() {
gulp.src(['*.json'])
.pipe(Hjson({ to: 'hjson' }))
.pipe(gulp.dest('output'));
});
Convert to JSON.
Convert to Hjson.