CLI to sync only basic properties from package.json to bower.json.
Install with npm:
$ npm install sync-pkg --save
var sync = require('sync-pkg');
// omit fields using glob patterns
sync(['!description', '!foo*']);
// extend existing bower.json
sync(null, {
extend: true
});
// allow empty fields
sync(null, {
empty: true
});
Run sync-pkg
in the command line to create and/or update bower.json.
$ sync-pkg
- If
bower.json
exists, it will be updated with values in package.json. - If
bower.json
does not exist, you will be asked if you want to create one.
Create a bower.json file and/or update the existing bower.json. Equivalent to running sync-pkg
without the bower
command, except that it will automatically create a bower.json file if one does not exist, and you will not be prompted.
$ sync-pkg bower
See a visual diff of proposed changes between package.json and bower.json. Does not modify any files.
$ sync-pkg diff
Example output
The following fields from package.json are used:
name
: requireddescription
: recommendedlicense
: recommendedmain
: recommendedignore
: recommendedkeywords
: recommended
These fields are also included, but are considered optional by bower:
repository
homepage
authors
dependencies
devDependencies
Pull requests or feature requests are welcome!
You might also be interested in these projects:
- filter-object: Filter an object by its keys or values. Returns a copy of an object filtered… more | homepage
- load-pkg: Loads the package.json from the root of the user's current project. | homepage
- omit-empty: Recursively omit empty properties from an object. Omits empty objects, arrays, strings or zero. | homepage
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Generate readme and API documentation with verb:
$ npm install verb && npm run docs
Or, if verb is installed globally:
$ verb
Install dev dependencies:
$ npm install -d && npm test
Jon Schlinkert
Copyright © 2016, Jon Schlinkert. Released under the MIT license.
This file was generated by verb, v0.9.0, on May 13, 2016.