gulp-add-json-file
Add a JSON formatted file to a gulp stream.
Install gulp-add-json-file
This module requires node.js 8 or above.
npm i -D gulp gulp-add-json-file pump
Usage
'use strict'; const gulp = ;const gulpAddJSON = ;const pump = ; gulp;
gulpAddJSON(filename, object, space)
- filename: The filename to use when adding a vinyl object
- object: The JavaScript object to stringify as contents of the vinyl object
- space: Passed directly to JSON.stringify.
U+2028 and U+2029
Literal code points U+2028 and U+2029 are escaped for maximum compatibility.
Duplicate files
This module should not be used to add a duplicate filename to the gulp stream. In
the above example if src/filename.json
exists it should be filtered out from
gulp.src
.
Running tests
Tests are provided by xo and ava.
npm installnpm test