Skip to content

Instantly share code, notes, and snippets.

View aqilc's full-sized avatar
🏠
Working from home

Aqil Contractor aqilc

🏠
Working from home
View GitHub Profile
@aqilc
aqilc / fetch.js
Created July 11, 2020 02:43
A simple fetch module.
// HTTPS API
import https from "https";
/**
* Executes an HTTP request
* @param {string | URL} url The url
* @returns {Promise<any>} The response
*/
export default (url, { method, headers, data } = {}) => new Promise((res, rej) => {