gcs

gulp-config-sync

Automatically synchronize bower.json with package.json

Showing:

Popularity

Downloads/wk

18

GitHub Stars

10

Maintenance

Last Commit

6yrs ago

Contributors

1

Package

Dependencies

4

Size (min+gzip)

36.2KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

#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

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial