@cloudflare/unenv-preset
Version:
cloudflare preset for unenv
25 lines (15 loc) • 604 B
Markdown
[](https://github.com/unjs/unenv) preset for cloudflare.
unenv provides polyfills to add [Node.js](https://nodejs.org/) compatibility for any JavaScript runtime, including browsers and edge workers.
```ts
import { cloudflare } from "@cloudflare/unenv-preset";
import { defineEnv } from "unenv";
const { env } = defineEnv({
presets: [cloudflare],
});
const { alias, inject, external, polyfill } = env;
```
See the unenv [README](https://github.com/unjs/unenv/blob/main/README.md) for more details.
This package is tested via wrangler e2e tests.