THIS PACKAGE IS A JOKE AND IS NOT TO BE USED FOR ACTUAL APPLICATIONS. IF YOU NEED THIS PACKAGE, ONLY GOD HIMSELF CAN GET YOU OUT OF IT.
Extract JSON from a string that contains a bunch of crap before or after a valid JSON Object.
npm i get-if-has-json
const json = require('get-if-has-json')
json('foo { } bar')
// Output: {}
str
{String}
String that contains a JSON object.
{Object}
Parsed JSON.