just-is-json

1.0.0 • Public • Published

just-is-json

NPM version Travis Build Status dependencies Status devDependencies Status Greenkeeper badge

Just check if a string is a valid JSON string

Installation

npm i just-is-json

API

const isJSON = require("just-is-json");
 
isJSON('{"foo":"bar"}'); // true
isJSON("1"); // true
isJSON("null"); // true
isJSON("[1,2,3]"); // true
isJSON(1); // true
isJSON(null); // true
isJSON("true"); // true
isJSON(true); // true
 
isJSON("not-json"); // false
isJSON([1, 2, 3]); // false
isJSON({ foo: "bar" }); // false
isJSON('{"foo":"bar}'); // false

Changelog

License

Package Sidebar

Install

npm i just-is-json

Weekly Downloads

3

Version

1.0.0

License

MIT

Last publish

Collaborators

  • cap-bernardito
  • evilebottnawi
  • itgalaxy-owner