# package-json-comment

> This package is used to add comments in package.json

Latest version **0.2.3** (published 2023-03-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install package-json-comment
pnpm add package-json-comment
yarn add package-json-comment
bun add package-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.2.3 |
| Published | 2023-03-09 |
| First published | 2023-03-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | SFCMN |
| Maintainers | sfcmn |
| Keywords | package.json, comment |

## Links

- npm: https://www.npmjs.com/package/package-json-comment
- Repository: https://github.com/SFCMN/package-json-comment
- Homepage: https://github.com/SFCMN/package-json-comment#readme
- Issues: https://github.com/SFCMN/package-json-comment/issues
- npm.io page: https://npm.io/package/package-json-comment

## 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.3 (latest) — 2023-03-09
- 0.2.2 — 2023-03-08
- 0.2.1 — 2023-03-08
- 0.2.0 — 2023-03-08

## README

# package-json-comment

This package is used to add comments in `package.json`.

## Background

In the past, in order to solve the security vulnerabilities of some dependent packages, I had to upgrade some dependent package versions.


However, the upgrade work is not easy, and various version conflicts, missing configurations, breaking changes and other issues are often encountered.


And in order to solve such issues, I have to change some configurations or add additional packages.


If the configuration file is a `.js` file, then I can add comments to it so that it can be optimized in the future. However, in `package.json`, I cannot directly add comments. But without the slightest explanation, some third-party packages introduced to solve existing issues may become dead packages that no one dares to remove, which is not what I expected.


So, taking advantage of some features of the `package.json` file, I made this empty package.

## Usage

In order to add comments to the `.json` file without introducing additional workload, my suggestion is to add a field directly and use the value of the field as the comment content.

And, in order to avoid npm errors, the field name uses `package-json-comment`, which is the name of this package.

You just need to add this package:

```bash
npm install --save-dev package-json-comment
```

Then, you can add comment in `package.json` file, the following is an example:

```json
{
  "name": "package-json-comment",
  "version": "0.2.3",
  "description": "This package is used to add comments in package.json",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/SFCMN/package-json-comment.git"
  },
  "keywords": [
    "package.json",
    "comment"
  ],
  "author": {
    "email": "wsfcmn@163.com",
    "name": "SFCMN"
  },
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/SFCMN/package-json-comment/issues"
  },
  "package-json-comment": "This is a test to verify that the package itself is available",
  "homepage": "https://github.com/SFCMN/package-json-comment#readme",
  "scripts": {
    "lint": "eslint --ext .js .",
    "package-json-comment": "This is a comment"
  },
  "devDependencies": {
    "eslint": "^8.34.0",
    "eslint-config-airbnb-base": "^15.0.0",
    "eslint-plugin-import": "^2.27.5",
    "package-json-comment": "^0.2.3",
    "package-json-comment": "This-is-a-test-to-verify-that-the-package-itself-is-available"
  },
  "dependencies": {
    "package-json-comment": "This is a test to verify that the package itself is available"
  }
}

```

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