package-json-flatten
v0.6.0
Published
Tools flatten package.json format
Downloads
7
Readme
package-json-flatten
Tools flatten package.json format.
Getting Started
Install to using npm.
$ npm install -g package-json-flatten
The package-json-flatten
command should be available right now.
Here is an example of package.json.
{
"name": "my-node-project",
"version": "0.1.0",
"description": "My Node.js Project",
"scripts": {
"test": "grunt"
},
"dependencies": {
"express": "*"
},
"main": "index.js",
"homepage": "http://www.example.com/",
"author": "Ryuichi Okumura <[email protected]>",
"repository": {
"type": "git",
"url": "http://www.example.com/"
},
"devDependencies": {
"jshint": "*"
}
}
Run package-json-flatten
command.
$ package-json-flatten
It finds the package.json file in the current directory in default and reformat it based on order the npm official package.json reference.
{
"name": "my-node-project",
"version": "0.1.0",
"description": "My Node.js Project",
"homepage": "http://www.example.com/",
"author": "Ryuichi Okumura <[email protected]>",
"main": "index.js",
"repository": {
"type": "git",
"url": "http://www.example.com/"
},
"scripts": {
"test": "grunt"
},
"dependencies": {
"express": "*"
},
"devDependencies": {
"jshint": "*"
}
}
Options
-f, --file [file]
An option to pass a path to package.json. It read the package.json in the current directory in default.
$ package-json-flatten -f src/package.json
-i, --indent [indent]
An option to change an indent style of the package.json. It detects indent style from the package.json and use it, or use default indent style 4 whitespace.
$ package-json-flatten -i ' '
Contributing
See the CONTRIBUTING.md.
Author
- Ryuichi Okumura (@okuryu)
License
package-json-flatten is licensed under the BSD license.
- commander is licensed under the MIT License.
- detect-indent is licensed under the MIT License.