<commit_before># package-json-flatten

[![npm Version][npm Version Badge]][npm Version]
[![Build Status][Build Status Badge]][Build Status]
[![Dependency Status][Dependency Status Badge]][Dependency Status]
[![Coverage Status][Coverage Status Badge]][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.

```
$ package-json-flatten -h

Usage: node package-json-flatten [options]

Options:
   -f FILE, --file FILE         Path to package.json file  [package.json]
   -i INDENT, --indent INDENT   Number of whitespace to indent  [2]

```

Here is the example of package.json.

```js
{
  "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": "<NAME> <<EMAIL>>",
  "repository": {
    "type": "git",
    "url": "http://www.example.com/"
  },
  "devDependencies": {
    "jshint": "*"
  }
}
```

Run `package-json-flatten` command.

```
$ package-json-flatten
```

It will finds the package.json file in the current directory in default and reformat it based on order the [npm official package.json reference][package.json docs].

```js
{
  "name": "my-node-project",
  "version": "0.1.0",
  "description": "My Node.js Project",
  "homepage": "http://www.example.com/",
  "author": "<NAME> <<EMAIL>>",
  "main": "index.js",
  "repository": {
    "type": "git",
    "url": "http://www.example.com/"
  },
  "scripts": {
    "test": "grunt"
  },
  "dependencies": {
    "express": "*"
  },
  "devDependencies": {
    "jshint": "*"
  }
}
```

## Integration with npm scripts

You also can run flattening as npm script as follow.

```
$ npm install package-json-flatten --save-dev
```

Specify a npm script within your `package.json`.

```js
  "scripts": {
    "flatten": "package-json-flatten"
  }
```

The npm script is available now.

```
$ npm run flatten
```

## Contributing

See the [CONTRIBUTING.md](CONTRIBUTING.md).

## Author

* <NAME> ([@okuryu])

## License

This module is licensed under the [BSD license](LICENSE).

* [nomnom] is licensed under the MIT License.
* [detect-indent] is licensed under the MIT License.

[npm Version Badge]: https://img.shields.io/npm/v/package-json-flatten.svg?style=flat-square
[npm Version]: https://www.npmjs.com/package/package-json-flatten
[Build Status Badge]: http://img.shields.io/travis/okuryu/package-json-flatten.svg?style=flat-square
[Build Status]: https://travis-ci.org/okuryu/package-json-flatten
[Dependency Status Badge]: https://img.shields.io/gemnasium/okuryu/package-json-flatten.svg?style=flat-square
[Dependency Status]: https://gemnasium.com/okuryu/package-json-flatten
[Coverage Status Badge]: https://img.shields.io/coveralls/okuryu/package-json-flatten.svg?style=flat-square
[Coverage Status]: https://coveralls.io/r/okuryu/package-json-flatten?branch=master
[package.json docs]: https://docs.npmjs.com/files/package.json
[@okuryu]: https://github.com/okuryu
[nomnom]: https://github.com/harthur/nomnom
[detect-indent]: https://github.com/sindresorhus/detect-indent<commit_msg>Use HTTPS image in README<commit_after># package-json-flatten

[![npm Version][npm Version Badge]][npm Version]
[![Build Status][Build Status Badge]][Build Status]
[![Dependency Status][Dependency Status Badge]][Dependency Status]
[![Coverage Status][Coverage Status Badge]][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.

```
$ package-json-flatten -h

Usage: node package-json-flatten [options]

Options:
   -f FILE, --file FILE         Path to package.json file  [package.json]
   -i INDENT, --indent INDENT   Number of whitespace to indent  [2]

```

Here is the example of package.json.

```js
{
  "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": "<NAME> <<EMAIL>>",
  "repository": {
    "type": "git",
    "url": "http://www.example.com/"
  },
  "devDependencies": {
    "jshint": "*"
  }
}
```

Run `package-json-flatten` command.

```
$ package-json-flatten
```

It will finds the package.json file in the current directory in default and reformat it based on order the [npm official package.json reference][package.json docs].

```js
{
  "name": "my-node-project",
  "version": "0.1.0",
  "description": "My Node.js Project",
  "homepage": "http://www.example.com/",
  "author": "<NAME> <<EMAIL>>",
  "main": "index.js",
  "repository": {
    "type": "git",
    "url": "http://www.example.com/"
  },
  "scripts": {
    "test": "grunt"
  },
  "dependencies": {
    "express": "*"
  },
  "devDependencies": {
    "jshint": "*"
  }
}
```

## Integration with npm scripts

You also can run flattening as npm script as follow.

```
$ npm install package-json-flatten --save-dev
```

Specify a npm script within your `package.json`.

```js
  "scripts": {
    "flatten": "package-json-flatten"
  }
```

The npm script is available now.

```
$ npm run flatten
```

## Contributing

See the [CONTRIBUTING.md](CONTRIBUTING.md).

## Author

* <NAME> ([@okuryu])

## License

This module is licensed under the [BSD license](LICENSE).

* [nomnom] is licensed under the MIT License.
* [detect-indent] is licensed under the MIT License.

[npm Version Badge]: https://img.shields.io/npm/v/package-json-flatten.svg?style=flat-square
[npm Version]: https://www.npmjs.com/package/package-json-flatten
[Build Status Badge]: https://img.shields.io/travis/okuryu/package-json-flatten.svg?style=flat-square
[Build Status]: https://travis-ci.org/okuryu/package-json-flatten
[Dependency Status Badge]: https://img.shields.io/gemnasium/okuryu/package-json-flatten.svg?style=flat-square
[Dependency Status]: https://gemnasium.com/okuryu/package-json-flatten
[Coverage Status Badge]: https://img.shields.io/coveralls/okuryu/package-json-flatten.svg?style=flat-square
[Coverage Status]: https://coveralls.io/r/okuryu/package-json-flatten?branch=master
[package.json docs]: https://docs.npmjs.com/files/package.json
[@okuryu]: https://github.com/okuryu
[nomnom]: https://github.com/harthur/nomnom
[detect-indent]: https://github.com/sindresorhus/detect-indent
{'fraction_non_alphanumeric': 0.17974798846212237, 'fraction_numerical': 0.0021253985122210413, 'mean_word_length': 4.025171624713959, 'pattern_counts': {'":': 64, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 23, 'lorem ipsum': 0, 'www.': 10, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4165099', 'n_tokens_mistral': 2385, 'n_tokens_neox': 2278, 'n_words': 533}