Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/berkmann18/json-fixer
A JSON checker and fixer
https://github.com/berkmann18/json-fixer
checker fixer json linter parser
Last synced: 5 days ago
JSON representation
A JSON checker and fixer
- Host: GitHub
- URL: https://github.com/berkmann18/json-fixer
- Owner: Berkmann18
- License: mit
- Created: 2019-04-16T13:46:55.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-05-19T20:25:31.000Z (over 1 year ago)
- Last Synced: 2024-10-24T14:32:22.605Z (13 days ago)
- Topics: checker, fixer, json, linter, parser
- Language: JavaScript
- Homepage:
- Size: 1.46 MB
- Stars: 14
- Watchers: 3
- Forks: 6
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
- [json-fixer](#json-fixer)
- [Usage](#usage)
- [Contributors β¨](#contributors-)# json-fixer
[![NPM](https://nodei.co/npm/json-fixer.png)](https://nodei.co/npm/json-fixer/)
[![GitHub package version](https://img.shields.io/github/package-json/v/Berkmann18/json-fixer.svg)](https://github.com/Berkmann18/json-fixer)
[![devDependencies Status](https://david-dm.org/berkmann18/json-fixer/dev-status.svg)](https://david-dm.org/berkmann18/json-fixer?type=dev)
[![dependencies Status](https://david-dm.org/berkmann18/json-fixer/status.svg)](https://david-dm.org/berkmann18/json-fixer)[![GH Downloads](https://img.shields.io/github/downloads/Berkmann18/json-fixer/total.svg)](https://github.com/Berkmann18/json-fixer/network/members)
[![GitHub commit activity the past year](https://img.shields.io/github/commit-activity/y/Berkmann18/json-fixer.svg)](https://github.com/Berkmann18/json-fixer/graphs/commit-activity)
[![GitHub contributors](https://img.shields.io/github/contributors/Berkmann18/json-fixer.svg)](https://github.com/Berkmann18/json-fixer/graphs/contributors)
[![Github search hit counter](https://img.shields.io/github/search/Berkmann18/json-fixer/goto.svg)](https://github.com/Berkmann18/json-fixer/graphs/traffic)[![Build Status](https://travis-ci.org/Berkmann18/json-fixer.svg?branch=master)](https://travis-ci.org/Berkmann18/json-fixer)
[![codecov.io Code Coverage](https://img.shields.io/codecov/c/github/Berkmann18/json-fixer.svg?maxAge=2592000)](https://codecov.io/github/Berkmann18/json-fixer?branch=master)
[![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest)
[![Known Vulnerabilities](https://snyk.io/test/github/Berkmann18/json-fixer/badge.svg?targetFile=package.json)](https://snyk.io/test/github/Berkmann18/json-fixer?targetFile=package.json)[![GitHub](https://img.shields.io/github/license/Berkmann18/json-fixer.svg)](https://github.com/Berkmann18/json-fixer/blob/master/LICENSE)
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/Berkmann18/json-fixer/issues)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)[![GitHub top language](https://img.shields.io/github/languages/top/Berkmann18/json-fixer.svg)](https://github.com/Berkmann18/json-fixer)
[![GitHub language count](https://img.shields.io/github/languages/count/Berkmann18/json-fixer.svg)](https://github.com/Berkmann18/json-fixer)
[![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/Berkmann18/json-fixer.svg)](https://github.com/Berkmann18/json-fixer)[![BCH compliance](https://bettercodehub.com/edge/badge/Berkmann18/json-fixer?branch=master)](https://bettercodehub.com/results/Berkmann18/json-fixer)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/81690e927e4f49db939033daae75b2eb)](https://app.codacy.com/manual/maxieberkmann/json-fixer?utm_source=github.com&utm_medium=referral&utm_content=Berkmann18/json-fixer&utm_campaign=Badge_Grade_Dashboard)A JSON file fixer primarly focused to be used in a NodeJS file.
## Usage
- In NodeJS
```js
const jsonFix = require('json-fixer')
const fs = require('fs')// Get the (potentially malformed) JSON data ready
const jsonContent = fs.readFileSync('config.json', 'utf-8')const {data, changed} = jsonFix(jsonContent) // Lint (and fix) it
if (changed) {
// Do something with `data` which is the fixed JSON parsed data from `jsonContent`
// e.g. `fs.writeFileSync(configPath, JSON.stringify(data, null, 2))`
}
```- In the CLI
_Not supported yet_ (PR welcome).## Contributors β¨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
Maximilian Berkmann
π» π π€ π§ β οΈ π‘οΈ
Semantic Release Bot
π¦ π
all-contributors[bot]
π
Ben Kucera
π»
Svetozar Mateev
π π»
AndrΓ© Paulo
π
Erkin Matkaziev
π
Codacy Badger
π π
GiraffeKey
π» β οΈ
jonasmaertens
π
George Tsotsos
π»
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!