Skip to content

Provides a utility to extract and return JSON objects from a string

License

Notifications You must be signed in to change notification settings

macellan/json-extractify

Repository files navigation

@macellan/json-extractify

Description

Parses a string and extracts JSON objects from it.

Parameters

  • data (string): The string to parse.

Returns

  • Array of object: An array of parsed JSON objects.

Usage

Basic Example

import JsonExtractify from '@macellan/json-extractify'

const json = '{ "foo": "bar" } { "abc": "xyz" }'

const value = JsonExtractify.parse(json)

console.log(value)
// Output: [{ foo: 'bar' }, { abc: 'xyz' }]

About

Provides a utility to extract and return JSON objects from a string

Resources

License

Stars

Watchers

Forks

Packages

No packages published