Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

unxhr

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unxhr

Synchronous and asynchronous XMLHttpRequest for Node

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Synchronous and asynchronous XMLHttpRequest for Node

Build install size npm version

unxhr is a tiny wrapper of the built-in http client to emulate the browser XMLHttpRequest object.

Important: This library is a fork of XMLHttpRequest. It was created to be compliant with XMLHttpRequest Level 2.

Highlights

  • Dependency free
  • Asynchronous and synchronous requests
  • GET, POST, PUT, and DELETE requests
  • Binary data using JavaScript typed arrays
  • Follows redirects
  • Handles file:// protocol

Usage

Here's how to include the module in your project and use as the browser-based XHR object.

const XMLHttpRequest = require('unxhr').XMLHttpRequest
const xhr = new XMLHttpRequest()

Known Issues / Missing Features

For a list of open issues or to report your own visit the github issues page.

  • Local file access may have unexpected results for non-UTF8 files
  • Synchronous requests don't set headers properly
  • Synchronous requests freeze node while waiting for response (But that's what you want, right? Stick with async!).
  • Some events are missing, such as abort
  • Cookies aren't persisted between requests
  • Missing XML support

License

MIT license. See LICENSE for full details.

Keywords

FAQs

Package last updated on 11 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc