# format-package-json

> Format package.json based on the current one

Latest version **0.2.0** (published 2014-03-06) · BSD license · 0 weekly downloads

## Install

```sh
npm install format-package-json
pnpm add format-package-json
yarn add format-package-json
bun add format-package-json
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2014-03-06 |
| First published | 2014-02-16 |
| Weekly downloads | 0 |
| License | BSD |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Dav Glass |
| Maintainers | davglass |
| Keywords | format, package.json, formatter, helper |

## Links

- npm: https://www.npmjs.com/package/format-package-json
- Repository: https://github.com/davglass/format-package-json
- Issues: https://github.com/davglass/format-package-json/issues
- npm.io page: https://npm.io/package/format-package-json

## Dependencies (1)

- [detect-indent](https://npm.io/package/detect-indent.md) ~0.1.3

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.2.0 (latest) — 2014-03-06
- 0.1.0 — 2014-02-21
- 0.0.4 — 2014-02-20
- 0.0.3 — 2014-02-17
- 0.0.2 — 2014-02-17
- 0.0.1 — 2014-02-16

## README

format-package-json
===================

Module attempts to detect the spacing used, the final line ending.

It will then attempt to reformat an `Object` back into this string and save the file.

usage
-----

```js

var format = require('format-package-json')


format('/path/to/package.json', function (err, data) {
    //data - the string that it wrote

    //That's it
})
```

sync
----

  * `format.sync`
  * `format.readSync`
  * `format.writeSync`

build
-----

[![Build Status](https://travis-ci.org/davglass/format-package-json.png?branch=master)](https://travis-ci.org/davglass/format-package-json)

---
_Source: https://npm.io/package/format-package-json · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
