get-object-from-json
v2.0.1
Published
An alternative to JSON.parse() that gives more helpful error messages
Maintainers
Readme
getObjectFromJSON(jsonString): object
getObjectFromJSON() is a more helpful alternative to JSON.parse().
The reason? Better error messages. If you pass anything other than a
string, you get 'Input must be string', and if the string is not strictly
formatted as JSON, you get 'Argument is not in JSON format'.
Installation
npm i get-object-from-json
Loading
import { getObjectFromJSON } from 'get-object-from-json';