json-error-finder
Version:
A lightweight utility to find errors in JSON strings and provide detailed hints.
23 lines (17 loc) • 466 B
Markdown
# JSON Error Finder
A lightweight utility to find errors in JSON strings and provide detailed hints.
## Installation
## Usage
```javascript
const findJsonError = require('json-error-finder');
const result = findJsonError('{"key": "value",}'); // Invalid JSON
console.log(result);
// Output:
// {
// valid: false,
// error: {
// message: 'Unexpected token } in JSON at position 18',
// position: 18,
// hint: 'Error near: "value",}"'
// }
// }