@im-dims/api
v0.0.2
Published
Fetcher for Ssa API
Downloads
10
Readme
Official Fetcher for Ssa API
A module that simplifies fetching API data with clean, efficient, and readable code.
How to use ??
Api.get([endpoint], [parameter])Example
Here I give an example of fetching the Google Bard API with bard as endpoint and query as parameter.
const KasumiApi = require('@im-dims/api')
// It's recommended to define this as a global variable
const Api = new KasumiApi('https://api.ssateam.my.id/api', 'ykka')
Api.get('/ai/bard', {
query: 'Hello'
}).then(console.log)
// Async/await version
let json = Api.get('/ai/bard', {
query: 'Hello'
})
console.log(json)
// Fetching data as a buffer
let json = Api.get('r/waifu', {}, null, {
responseType: 'arraybuffer',
timeout: 15000
})
console.log(json)Result :
