1.0.7 • Published 7 years ago

is-json-promise v1.0.7

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

Build Status

Use

import 'is-json-promise';
// or: require('is-json-promise')

String.IsJSON(`iam here`)
   .then((object) => console.info(object))
   .catch((error) => alert('Waww, i cannot be JSON')) ; // promise will run catch

or

import 'is-json-promise';

String.IsJSON(`{"welcome":"Hello"}`)
   .then((object) => console.info(object)) // promise will run "then"
   .catch((error) => alert('Waww, i cannot be JSON')) ;

Safe import :

It will not extend the String class with a static method , but it will give you this method as a function :

import {IsJSON} from 'is-json-promise/safe';
//or: const {IsJSON}= require("is-json-promise/safe");

IsJSON(`{"welcome":"Hello"}`)
   .then((object) => console.info(object)) // promise will run "then"
   .catch((error) => alert('Waww, i cannot be JSON')) ;
1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.0.1

7 years ago