grunt-sync-pkg
Version:
Minimalist Grunt plugin to sync only basic properties between package.json and bower.json
70 lines (43 loc) • 2.15 kB
Markdown
# grunt-sync-pkg [](http://badge.fury.io/js/grunt-sync-pkg) [](true)
> Minimalist Grunt plugin to keep package.json and bower.json synchronized
By default, this plugin syncs the following properties from `package.json` to `bower.json`:
* `name`
* `version`
* `main`
Note that if a `bower.json` file does not exist, the plugin creates on first. There is no option to turn this off, since there is no reason to use the plugin if you aren't syncing with anything :-).
## Getting Started
_If you haven't used [grunt][] before, be sure to check out the [Getting Started][] guide._
From the same directory as your project's [Gruntfile][Getting Started] and [package.json][], install this plugin with the following command:
```bash
npm install grunt-sync-pkg --save-dev
```
Once that's done, add this line to your project's Gruntfile:
```js
grunt.loadNpmTasks('grunt-sync-pkg');
```
If the plugin has been installed correctly, you should now be able to run `grunt sync` at the command line to run the `sync` task.
## Options
### include
Type: `Array`
Default: `['name', 'version', 'main']`
Properties to sync from `package.json` to `bower.json`.
### exclude
Type: `Array`
Default: `undefined`
Properties to exclude from syncing.
### alt
Type: `Obj`
Default: `undefined`
Specify an additional JSON file to sync, such as `myplugin.jquery.json`.
## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [grunt][].
## Author
**Jon Schlinkert**
+ [http://twitter.com/jonschlinkert](http://twitter.com/jonschlinkert)
+ [http://github.com/jonschlinkert](http://github.com/jonschlinkert)
## Copyright and License
Copyright (c) 2013 Jon Schlinkert
Released under the [MIT License](LICENSE-MIT).
[grunt]: http://gruntjs.com/
[Getting Started]: https://github.com/gruntjs/grunt/blob/devel/docs/getting_started.md
[package.json]: https://npmjs.org/doc/json.html