Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including gulp-extend with all npm packages installed. Try it out:

var gulpExtend = require("gulp-extend")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

gulp-extend v0.2.0

A gulp plugin to extend (merge) JSON contents

gulp-extend NPM version Build Status Dependency Status

A gulp plugin to extend (merge) json contents


First, install gulp-extend as a development dependency:

npm install  gulp-extend --save-dev

Then, add it to your gulpfile.js:

Extend the contents of json files

var extend = require('gulp-extend');


Extend the contents of a json file and then wrap them in a code block

var extend = require('gulp-extend');
var wrap = require('gulp-wrap');

    .pipe(extend('text.en.js') //use .js extension since we plan to wrap
    .pipe(wrap('angular.module(\'text\', []).value(<%= contents %>);'))


extend(fileName[, deep [, jsonSpace]])


Type: String

The output filename


Type: Boolean
Default: true

If the extend should be deep.


Type: String or Number
Default: undefined

JSON.stringify's space attribute for pretty-printing the resulting JSON.
See MDN docs on JSON.stringify() for more information.


MIT License

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free