Socket
Socket
Sign inDemoInstall

gulp-add-json-file

Package Overview
Dependencies
15
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gulp-add-json-file

Add a JSON formatted file to a gulp stream.


Version published
Weekly downloads
188
decreased by-17.18%
Maintainers
1
Install size
236 kB
Created
Weekly downloads
 

Readme

Source

gulp-add-json-file

Travis CI Greenkeeper badge NPM Version NPM Downloads MIT

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 = require('gulp');
const gulpAddJSON = require('gulp-add-json-file');
const pump = require('pump');

gulp.task('default', () => {
	/* Copy 'src/**' to 'dest', add 'filename.json' from JS object. */
	return pump(
		gulp.src('src/**'),
		gulpAddJSON('filename.json', {field: 'value'}),
		gulp.dest('dest')
	);
});

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 install
npm test

Keywords

FAQs

Last updated on 06 Jun 2019

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc