@niknils/requests

0.1.0 • Public • Published

@niknils/requests

make sync and async requests in web

support engines

  • Node.js (fetch & child_proc for sync)
  • Browser (XMLHttpRequest for sync)

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

Package Sidebar

Install

npm i @niknils/requests

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

34.8 kB

Total Files

4

Last publish

Collaborators

  • niknils