Skip to content

MaxArt2501/gulp-json-fmt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gulp-json-fmt

Gulp.js plugin wrapping the json-fmt module.

Installation

You'll probably use this plugin together with gulp.js as build tool/task runner:

npm install --save-dev gulp-json-fmt

Usage

This is a pretty basic usage, taking JSON files from a directory and writing them in another one after the transformation:

var jsonFmt = require("gulp-json-fmt");

gulp.src("./data/*.json")
    .pipe(jsonFmt())
    .pipe(gulp.dest("./data/minified"));

jsonFmt() can accept an object as the argument containing the options for the JSONFormatter class. In addition, jsonFmt.MINI and jsonFmt.PRETTY are references to JSONFormatter.MINI and JSONFormatter.PRETTY respectively (see json-fmt's page for more informations):

gulp.src("./data/*.json")
    .pipe(jsonFmt({ spacedArray: true, spacedObject: true }))

gulp.src("./data/*.json")
    .pipe(jsonFmt(jsonFmt.PRETTY))

License

MIT. See LICENSE for details.

About

Gulp plugin for JSON formatting with json-fmt

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published