@niknils/requests
make sync and async requests in web
support engines
- Node.js (
fetch & child_proc
forsync
) - Browser (
XMLHttpRequest
forsync
)
note
-
async
methods in developing; see repository for more
import
cdn or Node.js:
var { req } = require('@niknils/requests');
sync
//false for sync or detect by onsuccess and onerror functions
req(false, "my request")
.then(200, ()=>{
console.log('HTTP code - 200');
}).else((r)=>{
console.log(`HTTP code - ${r.code}`);
})
this prorotype of readme; actual documentation see in repository