her-promise
Version:
This is a polyfill of the ES6/ES9/ES11/ES12 Promise.
104 lines (78 loc) • 1.35 kB
Markdown
[![npm][npm]][npm-url]
[![node][node]][node-url]
[![size][size]][size-url]
> This is a polyfill of the ES6/ES9/ES11/ES12 Promise.
npm:
```sh
$ npm install --save her-promise
```
yarn:
```sh
$ yarn add her-promise
```
```html
<script src="her-promise.js"></script>
```
```html
<script>
new Promise((resolve, reject) => {
reject();
}).finally(() => {
// ...
});
Promise.race([
// ...
]).then(() => {
// ...
});
Promise.allSettled([
// ...
]).then(() => {
// ...
});
Promise.any([
// ...
]).then(() => {
// ...
});
</script>
```
```js
// You can import in entry file at first
import 'her-promise';
new Promise((resolve, reject) => {
reject();
}).finally(() => {
// ...
});
Promise.race([
// ...
]).then(() => {
// ...
});
Promise.allSettled([
// ...
]).then(() => {
// ...
});
Promise.any([
// ...
]).then(() => {
// ...
});
```
[](./LICENSE)
[]: https://img.shields.io/npm/v/her-promise.svg
[]: https://npmjs.com/package/her-promise
[]: https://img.shields.io/node/v/her-promise.svg
[]: https://nodejs.org
[]: https://packagephobia.now.sh/badge?p=her-promise
[]: https://packagephobia.now.sh/result?p=her-promise