1.0.5 • Published 3 years ago

fetch-json-data v1.0.5

Weekly downloads
1
License
ISC
Repository
github
Last release
3 years ago

fetch-json-data

Node library for getting JSON document

Install

npm install --save fetch-json-data

Usage

const getData=require('fetch-json-data')


// promise
let dataObj;
let url = http() + ip + '/getData', method = 'post';
getData(url, method)
.then(function (result) {
    console.dir(result);
    dataObj = result;
})
.catch(function(error){
    console.log(error);
});


// async/await
(async function(){
    let dataObj;
    let url = http() + ip + '/getData', method = 'post';
    try{
        const result = await getData(url, method);
        dataObj = result;
    } catch (error) {
        console.log(error);
    }
})();
1.0.5

3 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago