# p-defer-es5

Latest version **2.0.1** (published 2022-02-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install p-defer-es5
pnpm add p-defer-es5
yarn add p-defer-es5
bun add p-defer-es5
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2022-02-28 |
| First published | 2019-12-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >= 12.2.0 |
| Dependencies | 8 |
| Unpacked size | 39.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | yes |
| GitHub stars | 1 |
| Author | William Wong <compulim@hotmail.com> (http://compulim.info/) |
| Maintainers | compulim, spyip |
| Keywords | defer, deferred, p-defer, promise |

## Links

- npm: https://www.npmjs.com/package/p-defer-es5
- Repository: https://github.com/compulim/p-defer-es5
- Homepage: https://github.com/compulim/p-defer-es5#readme
- Issues: https://github.com/compulim/p-defer-es5/issues
- npm.io page: https://npm.io/package/p-defer-es5

## Dependencies (8)

- [mkdirp](https://npm.io/package/mkdirp.md) ^1.0.4
- [esbuild](https://npm.io/package/esbuild.md) ^0.14.23
- [@babel/cli](https://npm.io/package/@babel/cli.md) ^7.17.6
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.17.5
- [read-pkg-up](https://npm.io/package/read-pkg-up.md) ^9.1.0
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) ^7.16.11
- [@babel/runtime-corejs3](https://npm.io/package/@babel/runtime-corejs3.md) ^7.17.2
- [@babel/plugin-transform-runtime](https://npm.io/package/@babel/plugin-transform-runtime.md) ^7.17.0

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 2.0.1 (latest) — 2022-02-28
- 2.0.2-main.8f0c8ec (main) — 2022-03-01
- 2.0.1-main.2419213 (master) — 2022-02-28
- 2.0.2-main.2ced082 — 2022-02-28
- 2.0.2-main.638e00c — 2022-02-28
- 2.0.1-main.c12682c — 2022-02-28
- 2.0.1-main.bac85c3 — 2022-02-28
- 2.0.1-main.4b406f8 — 2022-02-28
- 2.0.1-master.2419213 — 2022-02-28
- 2.0.1-master.64662a9 — 2022-02-28
- 2.0.1-master.af51e8d — 2021-07-20
- 2.0.0 — 2021-07-20
- 2.0.0-master.7c4e2ba — 2021-07-19
- 2.0.0-master.2ee291d — 2021-07-18
- 2.0.0-master.95a11a8 — 2021-07-18
- … 32 more at https://npm.io/package/p-defer-es5/versions

## README

# p-defer-es5

[![npm version](https://img.shields.io/npm/v/p-defer-es5.svg)](https://www.npmjs.com/package/p-defer-es5) [![npm version](https://img.shields.io/npm/v/p-defer-es5/main.svg)](https://www.npmjs.com/package/p-defer-es5/v/main) [![Continuous deployment](https://github.com/compulim/p-defer-es5/actions/workflows/continuous-deployment.yml/badge.svg?branch=main)](https://github.com/compulim/p-defer-es5/actions/workflows/continuous-deployment.yml)

This package is based on [`p-defer`](https://npmjs.com/package/p-defer). It did not contains an ES5 module. Importing the module directly or indirectly may break web apps running on ES5 browsers.

On `npm install`, this package will transpile your version of `p-defer` to make it compatible with ES5 browsers. Then in your code, you use `p-defer-es5` instead of `p-defer`.

Package authors should consider importing this package instead of `p-defer`, so your packages will not break your users due to having `p-defer` as a transient dependency.

## How to use

To install in your project, run:

```sh
npm install p-defer p-defer-es5
```

You can also use it in HTML:

```html
<script src="https://unpkg.com/p-defer/dist/p-defer-es5.production.min.js"></script>
```

## How it works

On `postinstall`, this package will run `esbuild` to bundle `p-defer` into a single file. Then run Babel to transpile it for ES5.

This package peer-depends on `p-defer`. Thus, you can select your own version of `p-defer`.

### Updating `p-defer`

When you update `p-defer`, re-run `npm install p-defer-es5` to get the latest package transpiled.

## Alternatives

Instead of importing this package, there are alternative workarounds you can use.

### Including the source code

You can copy the source code of `p-defer` into your web app and use your build pipeline transpile the original package.

Be sure to include the original license and continue to depends on the package to make sure `npm audit` will scan for vulnerabilities.

### Modify your bundler configuration

Some bundlers is configured not to transpile code under `/node_modules/` unless specified explicitly. You can modify bundler configuration to include `/node_modules/p-defer/` and use Babel to transpile it while bundling.

## Contributions

Like us? [Star](https://github.com/compulim/p-defer-es5/stargazers) us.

Want to make it better? [File](https://github.com/compulim/p-defer-es5/issues) us an issue.

Don't like something you see? [Submit](https://github.com/compulim/p-defer-es5/pulls) a pull request.

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