1.0.5 • Published 3 years ago

grand-api v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

grand-api

I made this module simple.
간단하게 만들어봤습니다.


example)

const Api = require("grand-api");
const Client = new Api("https://api.grandkiwi.kro.kr");

console.log(Client.url);
/*
  => 'https://api.grandkiwi.kro.kr'
 */


Client.setPath("/background.json"); 

console.log(Client.path);
/*
  => '/background.json'
 */


Client.setHeader("header");

console.log(Client.header);
/*
  => 'header'
 */


Client.setQuery(["key=key", "key2=key2"]);

console.log(Client.query);
/*
  => ['key=key', 'key2=key2']
 */


console.log(Client.result(true));
/*
  => {
       url: 'https://api.grandkiwi.kro.kr/background.json?key=key&key2=key2',
       header: 'header'
     }
 */


async function Run () {
    return console.log(await Client.data());
}

Run();
/*
  => json data
 */


console.log(Client);
/*
  => {
       url: 'https://api.grandkiwi.kro.kr',
       type: null,
       path: '/background.json',
       header: 'header',
       query: ['key=key', 'key2=key2'],
       version: '1.0.5'
     }
 */
1.0.5

3 years ago

1.0.4

3 years ago

1.0.2

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago