2.0.1 • Published 3 years ago

get-object-from-json v2.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

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';