0.6.0 • Published 8 years ago

package-json-flatten v0.6.0

Weekly downloads
3
License
BSD-3-Clause
Repository
github
Last release
8 years ago

package-json-flatten

npm Version Build Status Dependency Status Coverage Status

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 <okuryu@okuryu.com>",
  "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 <okuryu@okuryu.com>",
  "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

License

package-json-flatten is licensed under the BSD license.

0.6.0

8 years ago

0.5.0

8 years ago

0.4.0

9 years ago

0.3.0

9 years ago

0.2.1

9 years ago

0.2.0

10 years ago

0.1.0

10 years ago