Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
lib/ | 25-Sep-2023 | - | 756 | 493 | ||
LICENSE | D | 24-Sep-2023 | 1.1 KiB | 23 | 19 | |
README.md | D | 24-Sep-2023 | 1.6 KiB | 44 | 30 | |
package.json | D | 24-Sep-2023 | 1.2 KiB | 57 | 56 |
README.md
1> Synchronous and asynchronous XMLHttpRequest for Node 2 3[](https://github.com/Mogztter/unxhr/actions?query=workflow%3ABuild) 4[](https://packagephobia.now.sh/result?p=unxhr) 5[](https://www.npmjs.com/package/unxhr) 6 7_unxhr_ is a tiny wrapper of the built-in `http` client to emulate the browser `XMLHttpRequest` object. 8 9**Important:** This library is a fork of [XMLHttpRequest](https://github.com/driverdan/node-XMLHttpRequest). 10It was created to be compliant with [XMLHttpRequest Level 2](http://www.w3.org/TR/XMLHttpRequest2/). 11 12## Highlights 13 14- Dependency free 15- Asynchronous and synchronous requests 16- `GET`, `POST`, `PUT`, and `DELETE` requests 17- Binary data using JavaScript typed arrays 18- Follows redirects 19- Handles `file://` protocol 20 21## Usage 22 23Here's how to include the module in your project and use as the browser-based XHR object. 24 25```js 26const XMLHttpRequest = require('unxhr').XMLHttpRequest 27const xhr = new XMLHttpRequest() 28``` 29 30## Known Issues / Missing Features 31 32For a list of open issues or to report your own visit the [github issues page](https://github.com/Mogztter/unxhr/issues). 33 34* Local file access may have unexpected results for non-UTF8 files 35* Synchronous requests don't set headers properly 36* Synchronous requests freeze node while waiting for response (But that's what you want, right? Stick with async!). 37* Some events are missing, such as abort 38* Cookies aren't persisted between requests 39* Missing XML support 40 41## License 42 43MIT license. See LICENSE for full details. 44