JSPM

  • Created
  • Published
  • Downloads 139787
  • Score
    100M100P100Q231093F
  • License MIT

A JSON fixer

Package Exports

  • json-fixer

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (json-fixer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

json-fixer

NPM

GitHub package version devDependencies Status dependencies Status

GH Downloads GitHub commit activity the past year GitHub contributors Github search hit counter

Build Status codecov.io Code Coverage tested with jest Known Vulnerabilities

GitHub contributions welcome Commitizen friendly

GitHub top language GitHub language count GitHub code size in bytes

BCH compliance Codacy Badge

A JSON file fixer primarly focused to be used in a NodeJS file.

Usage

  • In NodeJS
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

Maximilian Berkmann
Maximilian Berkmann

💻 📖 🤔 🚧 ⚠️
Semantic Release Bot
Semantic Release Bot

📦 📖
all-contributors[bot]
all-contributors[bot]

📖
Ben Kucera
Ben Kucera

💻

This project follows the all-contributors specification. Contributions of any kind welcome!