Huge Update

This commit is contained in:
killer069
2021-08-16 15:19:31 +05:30
parent 1b44ba8001
commit 97b1eed267
19 changed files with 321 additions and 28 deletions

View File

@@ -0,0 +1,12 @@
import fetch, { RequestInit } from 'node-fetch'
export async function url_get (url : string, options? : RequestInit) : Promise<string>{
return new Promise(async(resolve, reject) => {
let response = await fetch(url, options)
if(response.status === 200) {
resolve(await response.text())
}
else reject(`Got ${response.status} from ${url}`)
})
}