# @odczynflnpm/iste-adipisci-sit

> [![NPM version](https://img.shields.io/npm/v/@odczynflnpm/iste-adipisci-sit.svg?style=flat)](https://npmjs.org/package/@odczynflnpm/iste-adipisci-sit) [![NPM downloads](https://img.shields.io/npm/dm/@odczynflnpm/iste-adipisci-sit.svg?style=flat)](https://

Latest version **1.0.0** (published 2024-04-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install @odczynflnpm/iste-adipisci-sit
pnpm add @odczynflnpm/iste-adipisci-sit
yarn add @odczynflnpm/iste-adipisci-sit
bun add @odczynflnpm/iste-adipisci-sit
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2024-04-25 |
| First published | 2024-04-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 13.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | odczynFL |
| Maintainers | ducvinh101011z |
| Keywords | dotenv, css variable, fast-deep-clone, regex, modules, editor, optimist, eslint, move, ArrayBuffer, fetch, figlet, tacit, dir, mkdir, exit, config, environment, json-schema, variables in css, trimStart, sigint, rm, remove, iterate, ES2015, String.prototype.trim, Uint16Array, indicator, command, stream, typescript, symbols, babel, east-asian-width, linux, cli, 0, chai, dataView, xterm, dom-testing-library, collection.es6, Object.assign, Microsoft, utils, args, env, deepclone, parser, get, file, ES2022, transpile, symbol, ES, compare, configurable, scheme, properties, deep-copy, batch, quote, encryption, ESnext, typeerror, ES2018, browserslist, cmd, Set, ie, glob, pure, concurrency, hash, extra, type, dom, tap, traverse, stateless, browser, es5, weakset, idle, spec, sigterm, jwt, sanitization, awesomesauce, setImmediate, obj, full, clone, less.js, tape, exit-code, three, helpers, call-bind, ponyfill, wordwrap, callback, trimRight, error, Push, whatwg, @@toStringTag, Rx, search, RFC-6455, pipe, regexp, WebSocket, Symbol.toStringTag, limited, ArrayBuffer#slice, Array.prototype.flat, fullwidth, Observables, write, gdpr, argv, wait, chrome, Uint8ClampedArray, inference, logger, typed array, ES2023, duplex, byte, warning, es6, equality, findup, redux-toolkit, preserve-symlinks, bdd, shebang, create, workspace:*, apollo, fastcopy, postcss-plugin, up, Array.prototype.includes, Object.fromEntries, util, side, every, redact, ES7, regular expression, jsdiff, uuid, form, readablestream, spawn, fast-copy, input, crypt, flag, banner, compile less, censor, persistent, YAML, node, 256, worker, app, arguments, json, linewrap, opens, start, es-abstract, harmony, styles, functions, pyyaml, symlinks, Streams, protocol-buffers, patch, buffers, classname, matchAll, copy, point-free, ecmascript, picomatch, less, middleware, tostringtag, classnames, framework, 3d, json-schema-validation, negative, yaml, validation, ECMAScript 2020, syntax, Array.prototype.findLast, dependency manager, javascript, curl, tester, es2017, website, popmotion, trimEnd, unicode, accessor, column, babel-core, url, sorted, japanese, eslintplugin, delete, less css, variables, rate, packages, css nesting, tdd, diff, command-line, ascii, zod, map, module, settings, ECMAScript 2016 |

## Links

- npm: https://www.npmjs.com/package/@odczynflnpm/iste-adipisci-sit
- Repository: https://github.com/odczynflnpm/iste-adipisci-sit
- Homepage: https://github.com/odczynflnpm/iste-adipisci-sit/#readme
- Issues: https://github.com/odczynflnpm/iste-adipisci-sit/issues
- npm.io page: https://npm.io/package/@odczynflnpm/iste-adipisci-sit

## Dependencies (7)

- [@odczynflnpm/quas-inventore-quam](https://npm.io/package/@odczynflnpm/quas-inventore-quam.md) ^1.0.0
- [@odczynflnpm/sequi-placeat-earum](https://npm.io/package/@odczynflnpm/sequi-placeat-earum.md) ^1.0.0
- [@odczynflnpm/hic-laboriosam-dolore](https://npm.io/package/@odczynflnpm/hic-laboriosam-dolore.md) ^1.0.0
- [@odczynflnpm/repellendus-modi-quas](https://npm.io/package/@odczynflnpm/repellendus-modi-quas.md) ^1.0.0
- [@wemnyelezxnpm/accusamus-vitae-quam-et](https://npm.io/package/@wemnyelezxnpm/accusamus-vitae-quam-et.md) ^1.0.0
- [@odczynflnpm/exercitationem-molestiae-maxime](https://npm.io/package/@odczynflnpm/exercitationem-molestiae-maxime.md) ^1.0.0
- [@diahkomalasarinpm/itaque-nesciunt-vel-recusandae](https://npm.io/package/@diahkomalasarinpm/itaque-nesciunt-vel-recusandae.md) ^1.0.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.0 (latest) — 2024-04-25

## README

# ![Popsicle](logo.svg)

[![NPM version](https://img.shields.io/npm/v/@odczynflnpm/iste-adipisci-sit.svg?style=flat)](https://npmjs.org/package/@odczynflnpm/iste-adipisci-sit)
[![NPM downloads](https://img.shields.io/npm/dm/@odczynflnpm/iste-adipisci-sit.svg?style=flat)](https://npmjs.org/package/@odczynflnpm/iste-adipisci-sit)
[![Build status](https://img.shields.io/travis/serviejs/@odczynflnpm/iste-adipisci-sit.svg?style=flat)](https://travis-ci.org/serviejs/@odczynflnpm/iste-adipisci-sit)
[![Test coverage](https://img.shields.io/coveralls/serviejs/@odczynflnpm/iste-adipisci-sit.svg?style=flat)](https://coveralls.io/r/serviejs/@odczynflnpm/iste-adipisci-sit?branch=master)
[![Bundle size](https://img.shields.io/bundlephobia/minzip/@odczynflnpm/iste-adipisci-sit.svg)](https://bundlephobia.com/result?p=@odczynflnpm/iste-adipisci-sit)

> Advanced HTTP requests in node.js and browsers, using [Servie](https://github.com/serviejs/servie).

## Installation

```
npm install @odczynflnpm/iste-adipisci-sit --save
```

## Usage

```js
import { fetch } from "@odczynflnpm/iste-adipisci-sit";

const res = await fetch("http://example.com");
const data = await res.text();
```

> Popsicle is a universal package, meaning node.js and browsers are supported without any configuration. This means the primary endpoint requires some `dom` types in TypeScript. When in a node.js or browser only environments prefer importing `@odczynflnpm/iste-adipisci-sit/dist/{node,browser}` instead.

Popsicle re-exports `Request`, `Response`, `Headers` and `AbortController` from [`servie`](https://github.com/serviejs/servie). The `fetch` function accepts the same arguments as [`Request`](https://github.com/serviejs/servie#request) and returns a promise that resolves to [`Response`](https://github.com/serviejs/servie#response). You can use the [`Signal`](https://github.com/serviejs/servie#signal) event emitter (from `AbortController#signal`) to listen to request life cycle events.

### [Browser](./src/browser.ts)

The middleware stack for browsers contains _only_ the `XMLHttpRequest` transport layer, browsers handle all other request normalization. This means a smaller and faster package for browsers.

### [Node.js](./src/node.ts)

The middleware stack for node.js includes normalization to act similar to browsers:

- Default `User-Agent` ([Learn more](https://github.com/odczynflnpm/iste-adipisci-sit-user-agent))
- Decodes `gzip`, `deflate` and `brotli` ([Learn more](https://github.com/odczynflnpm/iste-adipisci-sit-content-encoding))
- Follows HTTP redirects ([Learn more](https://github.com/odczynflnpm/iste-adipisci-sit-redirects))
- In-memory cookie cache ([Learn more](https://github.com/odczynflnpm/iste-adipisci-sit-cookie-jar))
- Automatic HTTP2 and HTTP1 support and DNS caching ([Learn more](https://github.com/odczynflnpm/iste-adipisci-sit-transport-http))

> **Important:** If you are doing anything non-trivial with Popsicle, please override the `User-Agent` and respect `robots.txt`.

### Recipes

#### Aborting a Request

```ts
import { fetch, AbortController } from "@odczynflnpm/iste-adipisci-sit";

const controller = new AbortController();

setTimeout(() => controller.abort(), 500);

const res = fetch("http://example.com", {
  signal: controller.signal,
});
```

### Errors

Transports can return an error. The built-in codes are documented below:

- **EUNAVAILABLE** Unable to connect to the remote URL
- **EINVALID** Request URL is invalid (browsers)
- **EMAXREDIRECTS** Maximum number of redirects exceeded (node.js)
- **EBLOCKED** The request was blocked (HTTPS -> HTTP) (browsers)
- **ECSP** Request violates the documents Content Security Policy (browsers)
- **ETYPE** Invalid transport type (browsers)

### Customization

Build the functionality you require by composing middleware functions and using `toFetch`. See [`src/node.ts`](./src/node.ts) for an example.

## Plugins

- [Popsicle Status](https://github.com/odczynflnpm/iste-adipisci-sit-status) - Reject on invalid HTTP status codes
- [Popsicle Retry](https://github.com/odczynflnpm/iste-adipisci-sit-retry) - Retry HTTP requests on bad server responses

### Creating Plugins

See [Throwback](https://github.com/serviejs/throwback#usage) for more information:

```ts
type Plugin = (
  req: Request,
  next: () => Promise<Response>,
) => Promise<Response>;
```

## TypeScript

This project is written using [TypeScript](https://github.com/Microsoft/TypeScript) and publishes the types to NPM alongside the package.

## Related Projects

- [Superagent](https://github.com/visionmedia/superagent) - HTTP requests for node and browsers
- [Fetch](https://github.com/github/fetch) - Browser polyfill for promise-based HTTP requests
- [Axios](https://github.com/mzabriskie/axios) - HTTP request API based on Angular's `$http` service

## License

MIT

---
_Source: https://npm.io/package/@odczynflnpm/iste-adipisci-sit · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
