# xhr2-cookies

> XMLHttpRequest polyfill for node.js

Latest version **1.1.0** (published 2017-11-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install xhr2-cookies
pnpm add xhr2-cookies
yarn add xhr2-cookies
bun add xhr2-cookies
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2017-11-14 |
| First published | 2017-11-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Ionut Costica |
| Maintainers | souldreamer |
| Keywords | XMLHttpRequest, cookies, xhr2 |

## Links

- npm: https://www.npmjs.com/package/xhr2-cookies
- Repository: https://github.com/souldreamer/xhr2-cookies
- npm.io page: https://npm.io/package/xhr2-cookies

## Dependencies (1)

- [cookiejar](https://npm.io/package/cookiejar.md) ^2.1.1

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2017-11-14
- 1.0.3 — 2017-11-12
- 1.0.2 — 2017-11-12
- 1.0.1 — 2017-11-12
- 1.0.0 — 2017-11-12
- 0.9.3 — 2017-11-12
- 0.9.2 — 2017-11-12
- 0.9.1 — 2017-11-12
- 0.9.0 — 2017-11-12

## README

# XMLHttpRequest polyfill for node.js

Based on [https://github.com/pwnall/node-xhr2](https://github.com/pwnall/node-xhr2)

* Adds support for cookies
* Adds in-project TypeScript type definitions
* Switched to TypeScript

### Cookies

* saved in `XMLHttpRequest.cookieJar`
* saved between redirects
* saved between requests
* can be cleared by doing:
```typescript
import * as Cookie from 'cookiejar';
XMLHttpRequest.cookieJar = Cookie.CookieJar();
```

### Aims

* Provide full XMLHttpRequest features to Angular Universal HttpClient &
`node-angular-http-client`

### Changelog

#### `1.1.0`
* added saving of cookies between requests, not just redirects
* bug fixes
* most tests from `xhr2` ported over and passing

---
_Source: https://npm.io/package/xhr2-cookies · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
