This package has been deprecated

Author message:

Use fetch() instead

@rammbulanz/xhr
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@rammbulanz/xhr

XMLHttpRequest functions wrapping promises.

Hint

This is a node module.

Install

npm install @rammbulanz/xhr

Usage

// Javascript
var xhr = require("@rammbulanz/xhr");
// Typescript
import * as xhr from '@rammbulanz/xhr';

// ----------------
// GET Requests
// ----------------

// Using classic syntax
xhr.get("URL").then(function(response) {
    // Do something
});

// Using async/await syntax
var response = await xhr.get("URL");
// Do something

// ----------------
// POST Requests
// ----------------

// Using classic syntax
xhr.post("URL").then(function (response) {
    // Do something
});

// Using async/await syntax
var response = await xhr.post("URL");
// Do something

Package Sidebar

Install

npm i @rammbulanz/xhr

Weekly Downloads

0

Version

1.0.0

License

ISC

Last publish

Collaborators

  • rammbulanz