Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bogeychan/elysia-polyfills
Collection of experimental Elysia.js polyfills
https://github.com/bogeychan/elysia-polyfills
deno elysia nodejs polyfills shims
Last synced: 11 days ago
JSON representation
Collection of experimental Elysia.js polyfills
- Host: GitHub
- URL: https://github.com/bogeychan/elysia-polyfills
- Owner: bogeychan
- License: mit
- Created: 2023-04-23T04:26:15.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-05-09T20:48:41.000Z (7 months ago)
- Last Synced: 2024-11-18T04:34:19.292Z (26 days ago)
- Topics: deno, elysia, nodejs, polyfills, shims
- Language: TypeScript
- Homepage: https://npmjs.com/package/@bogeychan/elysia-polyfills
- Size: 201 KB
- Stars: 50
- Watchers: 1
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-elysia - Polyfills - Run on Node and Deno. (Plugins)
README
# @bogeychan/elysia-polyfills
Collection of experimental [Elysia.js](https://elysiajs.com) polyfills:
| Package | [Node.js](https://nodejs.org) (v18.16.0) | [Deno](https://deno.land) (1.36.4#1,3) |
| ---------------------------------------------------------------------------- | ---------------------------------------- | ------------------------------------------------- |
| [elysia](https://npmjs.com/package/elysia) (0.6.19#2) | π¬ | π¬ |
| [@elysiajs/cors](https://www.npmjs.com/package/@elysiajs/cors) (0.6.0) | β | β |
| [@elysiajs/html](https://www.npmjs.com/package/@elysiajs/html) (0.6.4) | β | β |
| [@elysiajs/bearer](https://www.npmjs.com/package/@elysiajs/bearer) (0.6.0) | β | β |
| [@elysiajs/cookie](https://www.npmjs.com/package/@elysiajs/cookie) (0.6.1) | β | β |
| [@elysiajs/swagger](https://www.npmjs.com/package/@elysiajs/swagger) (0.6.1) | β | β |
| [@elysiajs/static](https://www.npmjs.com/package/@elysiajs/static) (0.6.0) | β | β |
| ... | ... | ... |**_Legend_**
π¬ - Under testing
β - Fully supported
β οΈ - Partial supported
β - Unsupported
## π©Notes
#1 With release [1.33.0](https://github.com/denoland/deno/releases/tag/v1.33.0), `Deno` introduced a new way to resolve `node_modules` dependencies. You need to update `@bogeychan/elysia-polyfills` to at least version `0.0.7` in order to be compatible.
#2 With version [0.5.15](https://github.com/elysiajs/elysia/issues/50), `Elysia.js` supports `CommonJS`. Therefore, a build step is no longer required. The plugins listed above can be used out of the box for `ESM` and `CommonJS` projects.
#3 With release [1.35.0](https://github.com/denoland/deno/releases/tag/v1.35.0), `Deno` stabilized the `Deno.serve()` API. From now on `Deno.serve()` is used instead of the [Deno Standard Modules](https://github.com/denoland/deno_std).
## Installation
```bash
yarn add @bogeychan/elysia-polyfills
```## Usage
Checkout the [examples](./examples) folder on Github and follow its setup guide.
**_OR_** use an [Elysia.js scaffold](https://www.npmjs.com/package/create-elysia).
### Node.js
```ts
import '@bogeychan/elysia-polyfills/node/index.js';import { Elysia } from 'elysia';
new Elysia().get('/', () => ({ hello: 'Node.jsπ' })).listen(8080);
```Create a new `Node.js` project:
```bash
npm create elysia@latest my-elysia-app --template node-ts
```### Deno
```ts
import 'npm:@bogeychan/elysia-polyfills/deno/index.js';import { Elysia } from 'npm:elysia';
new Elysia().get('/', () => ({ hello: 'Denoπ' })).listen(8080);
```Create a new `Deno` project:
```bash
deno run -r=npm:create-elysia --allow-read --allow-write npm:create-elysia my-elysia-app --template deno
```## Author
[bogeychan](https://github.com/bogeychan)
## License
[MIT](LICENSE)