# json-linter-2

> JSON linter

Latest version **1.0.2** (published 2019-01-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install json-linter-2
pnpm add json-linter-2
yarn add json-linter-2
bun add json-linter-2
```

Provides the command `json-lint`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2019-01-07 |
| First published | 2019-01-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 45.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | medikoo |
| Keywords | lint, json |

## Links

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

## Dependencies (5)

- [fs2](https://npm.io/package/fs2.md) ^0.3
- [log](https://npm.io/package/log.md) ^3.2
- [es5-ext](https://npm.io/package/es5-ext.md) ^0.10.46
- [log-node](https://npm.io/package/log-node.md) ^3.2.1
- [minimist](https://npm.io/package/minimist.md) ^1.2

## 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

- 1.0.2 (latest) — 2019-01-07
- 1.0.1 — 2019-01-07
- 1.0.0 — 2019-01-07

## README

[![*nix build status][nix-build-image]][nix-build-url]
[![Windows build status][win-build-image]][win-build-url]
[![npm version][npm-image]][npm-url]

# json-lint

_Derived from [jslint-mod](https://github.com/circlecell/jsonlint-mod) by [Zach Carter](https://github.com/zaach) and [Andrey Gubanov](https://github.com/finom)_

## A JSON parser and validator

-   Confirms valid JSON format
-   Discards invalid whitespace chars
-   Errors on duplicate object keys

### Installation

_Soon to be hopefully published as `json-lint`_

```bash
npm install json-linter-2
```

### Usage

#### CLI

```bash
npx json-lint <path>
```

If `<path>` points a directory all `.json` files at directory and it's subdirectories (but excluding those ignored by `.gitignore` rules)
are checked.

If `<path>` ponts a file, then given file is linted

#### Programmatical

```javascript
const jsonLint = require("json-linter-2");

const jsonObject = jsonLint(jsonString); // Throws if JSON is invalid
```

### Tests

```bash
npm test
```

[nix-build-image]: https://semaphoreci.com/api/v1/medikoo-org/json-linter/branches/master/shields_badge.svg
[nix-build-url]: https://semaphoreci.com/medikoo-org/json-linter
[win-build-image]: https://ci.appveyor.com/api/projects/status/x07py6qbye37d1gj?svg=true
[win-build-url]: https://ci.appveyor.com/project/medikoo/json-linter
[npm-image]: https://img.shields.io/npm/v/json-linter.svg
[npm-url]: https://www.npmjs.com/package/json-linter

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