get-if-has-json
TypeScript icon, indicating that this package has built-in type declarations

2.0.10 • Public • Published

get-if-has-json

Tests Coverage Status Latest Stable Version NPM Downloads

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.

Install

npm i get-if-has-json

Usage

const json = require('get-if-has-json')

json('foo {  } bar')
// Output: {}

API

Parameters

  • str {String} String that contains a JSON object.

Returns

  • {Object} Parsed JSON.

Readme

Keywords

Package Sidebar

Install

npm i get-if-has-json

Weekly Downloads

0

Version

2.0.10

License

WTFPL

Unpacked Size

3.88 kB

Total Files

5

Last publish

Collaborators

  • de-ar