Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/myty/stage3
Polyfill for TC39 Stage 3 proposals
https://github.com/myty/stage3
Last synced: 1 day ago
JSON representation
Polyfill for TC39 Stage 3 proposals
- Host: GitHub
- URL: https://github.com/myty/stage3
- Owner: myty
- License: mit
- Created: 2023-08-20T19:28:50.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-21T11:41:41.000Z (about 1 year ago)
- Last Synced: 2024-11-10T18:58:15.582Z (7 days ago)
- Language: TypeScript
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Stage3
[![GitHub version](https://badgen.net/github/release/myty/stage3?color=green)](https://github.com/myty/stage3)
[![deno land](https://badgen.net/github/release/myty/stage3?color=green&label=deno.land)](https://deno.land/x/stage3)
[![npm version](https://badgen.net/npm/v/@myty/stage3?color=green)](https://www.npmjs.com/package/@myty/stage3)
[![Coverage Status](https://badgen.net/coveralls/c/github/myty/stage3?color=green)](https://coveralls.io/github/myty/stage3?branch=main)Polyfill for TC39 Stage 3 proposals
## Installation
### Node.js
```bash
# npm
npm install --save @myty/stage3
# yarn
yarn add @myty/stage3
# pnpm
pnpm install --save @myty/stage3
```### Deno
```bash
import "https://deno.land/x/stage3/mod.ts";
import "https://deno.land/x/stage3/promise-with-resolvers.ts";
```### Usage
```ts
import "@myty/stage3/script/promise-with-resolvers"; // Node.js (commonjs)
import "@myty/stage3/esm/promise-with-resolvers"; // Node.js (module)
import "https://deno.land/x/stage3/promise-with-resolvers.ts"; // Deno// Arrange
const resolvedValue = 5;
const { resolve, promise } = Promise.withResolvers();// Act
setTimeout(() => resolve(resolvedValue), 10);
const result = await promise;// Assert
assertEquals(result, resolvedValue);
```