This repository has been archived on 2024-01-16. You can view files and clone it, but cannot push or open issues or pull requests.
Files

29 lines
712 B
JavaScript

// Load Fetch.js
const fetchS = (...args) => import("node-fetch").then(mod => mod.default(...args));
// Set global fetch
if (typeof fetch === "undefined") global.fetch = fetchS;
// Request Json
const ReqJson = async (url = "", options) => await (await fetch(url, options)).json()
// Request Text
const ReqText = async (url = "", options) => `${await (await fetch(url, options)).text()}`
const ReqBuffer = async (url = "", options) => Buffer.from(await (await fetch(url, options)).arrayBuffer())
// Export Bds Request
module.exports = {
// JSON
JSON: ReqJson,
json: ReqJson,
// Raw Text
TEXT: ReqText,
text: ReqText,
// Buffer
BUFFER: ReqBuffer,
buffer: ReqBuffer
}