1.0.7 • Published 10 years ago

is-json-promise v1.0.7

Weekly downloads
1
License
MIT
Repository
github
Last release
10 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

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.0.1

10 years ago