
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
gulp-json-transform
Advanced tools
A gulp plugin to transform json files, pipe json files through it and transform them to other json files or other formats.
A gulp plugin to transform JSON files, pipe JSON files through it and transform them to other JSON files or other text based formats.
First install gulp-json-transform
as a development dependency:
npm install gulp-json-transform --save-dev
Then, add it to your gulpfile.js:
var jsonTransform = require('gulp-json-transform');
Then create a task that uses it:
gulp.task('do-something', function() {
gulp.src('./app/**/*.json')
.pipe(jsonTransform(function(data, file) {
return {
foobar: data.foo + file.relative
};
}))
.pipe(gulp.dest('./dist/out/'));
});
Type: function
A function that takes the JSON object and a file object (parameters path, base and relative are exposed) as the input parameters and should return either a string which is written raw to the file, a JSON object which is stringified or a Promise which resolves to a string or a JSON object.
Example structure of the file object:
{
path: 'test/fixtures/input.json',
relative: 'input.json',
base: 'test/fixtures'
}
Type: String
or Number
Default: undefined
JSON.stringify's whitespace attribute for pretty-printing the resulting JSON. See MDN docs on JSON.stringify() for more information.
FAQs
A gulp plugin to transform json files, pipe json files through it and transform them to other json files or other formats.
We found that gulp-json-transform demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.