Skip to content

medikoo/json-linter-2

Repository files navigation

*nix build status Windows build status npm version

json-linter-2

Derived from jslint-mod by Zach Carter and Andrey Gubanov

A JSON parser and validator

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

Installation

npm install json-linter-2

Usage

CLI

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

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

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

Tests

npm test

About

A JSON parser and validator

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published