# json-comment

> Make comments in the JSON data stream

Latest version **0.0.2** (published 2015-06-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install json-comment
pnpm add json-comment
yarn add json-comment
bun add json-comment
```

## 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.0.2 |
| Published | 2015-06-03 |
| First published | 2015-05-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Trey Griffith |
| Maintainers | treygriffith |
| Keywords | json, comment |

## Links

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

## Dependencies (1)

- [merge](https://npm.io/package/merge.md) ^1.2.0

## 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.0.2 (latest) — 2015-06-03
- 0.0.1 — 2015-05-20

## README

json-comment
------------

Write comments in JSON files by putting them in the data stream.
It's not a Good Thing, but it makes `JSON.parse` compliant files.

### Usage

```javascript

var jsonComment = require('json-comment');

var json = {
  hello: "world"
};

json = jsonComment.write(json, "This is my first JSON file.");
json = jsonComment.write(json, "It's quite good, don't you think?");

console.log(json);

// {
//   "hello": "world",
//   "__comments": [
//     "This is my first JSON file.",
//     "It's quite good, don't you think?"
//   ]
// }

console.log(jsonComment.read(json));

// This is my first JSON file.
// It's quite good, don't you think?

console.log(jsonComment.strip(json));

// {
//    "hello": "world"
// }

```

### Installation

```
$ npm install json-comment
```

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