Socket
Book a DemoInstallSign in
Socket

gulp-config-sync

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-config-sync

Synchronize version, name, description, keywords... in each config file (package.json, bower.json, component.js...).

1.0.2
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

#gulp-config-sync

GitHub version NPM version Build Status

Synchronize version, name, description, keywords... in each config file (package.json, bower.json, component.js...).

By default, package.json is used as the source of truth but you can specify any source and any fields you want to synchronize.

Only the fields specified are synchronized. The other fields are left untouched.

Gulp

This is a plugin for gulp 3.

Usage

Install gulp-config-sync as a development dependency

$ npm install gulp-config-sync --save-dev

In your gulpfile.js

// import plugin
var sync = require('gulp-config-sync');

gulp.task('sync', function() {
  gulp.src(['bower.json', 'component.json'])
    .pipe(sync())
    .pipe(gulp.dest('.')); // write it to the same dir
});

You can run the new task in the termininal

$ gulp sync

Or add it to existing tasks

gulp.task('default', ['sync']);

Options

  • src

    • Default package.json
    • The path to the source.json file
  • fields

    • Default [ 'name', 'version', 'description', 'keywords', 'repository', {from: 'contributors', to: 'authors'} ]
    • Specifies the fields to be synchronized
  • space

    • Default (2 whitespaces)
    • Used for prettyprinting the result. See JSON.stringify

Example

var options = {
  src: 'source.json',
  fields: [
    'name',
    'version',
    'description',
    {
      from: 'contributors',
      to: 'authors',
    },
  ],
  space: '    ',
};

gulp.src('bower.json')
  .pipe(sync(options))
  .pipe(gulp.dest(''));

LICENSE

MIT

Keywords

gulp

FAQs

Package last updated on 10 May 2015

Did you know?

Socket

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.