1.0.0 • Published 9 months ago

@nodifier/json v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

@nodifier/json

Utils for various JSON related tasks

How to use?

You can import the module to your code as follows:

import { tryParseJson } from "@nodify/json";

tryParseJson

import { tryParseJson } from "@nodify/json";

const jsonObject = tryParseJson('{\"foo\":\"bar\"}');

The above will return a JSON object and it will return the string as is if it is not JSON compliance.

isStrJson

import { isStrJson } from "@nodify/json";

const output = isStrJson('{\"foo\":\"bar\"}');

The above will return a boolean flag if the given string is a JSON compliance or not.