@cloudflare/unenv-preset
Advanced tools
Comparing version
{ | ||
"name": "@cloudflare/unenv-preset", | ||
"version": "0.0.0-5955dac5e", | ||
"version": "0.0.0-595f17092", | ||
"description": "cloudflare preset for unenv", | ||
@@ -28,11 +28,10 @@ "keywords": [ | ||
"types": "./dist/index.d.ts", | ||
"require": "./dist/index.cjs", | ||
"import": "./dist/index.mjs" | ||
}, | ||
"./runtime/*": { | ||
"types": "./dist/runtime/*.d.ts", | ||
"import": "./dist/runtime/*.mjs" | ||
} | ||
"./*": { | ||
"types": "./dist/runtime/*.d.mts", | ||
"default": "./dist/runtime/*.mjs" | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"main": "./dist/index.cjs", | ||
"types": "./dist/index.d.ts", | ||
@@ -43,12 +42,12 @@ "files": [ | ||
"devDependencies": { | ||
"@types/node": "*", | ||
"typescript": "~5.6.3", | ||
"unbuild": "^2.0.0", | ||
"undici": "^5.28.4", | ||
"vitest": "~2.1.8", | ||
"wrangler": "0.0.0-5955dac5e" | ||
"@types/node-unenv": "npm:@types/node@^22.13.1", | ||
"typescript": "^5.7.2", | ||
"unbuild": "^3.2.0", | ||
"undici": "^5.28.5", | ||
"vitest": "~3.0.5", | ||
"wrangler": "0.0.0-595f17092" | ||
}, | ||
"peerDependencies": { | ||
"unenv": "npm:unenv-nightly@*", | ||
"workerd": "^1.20241230.0" | ||
"unenv": "2.0.0-rc.8", | ||
"workerd": "^1.20250124.0" | ||
}, | ||
@@ -55,0 +54,0 @@ "peerDependenciesMeta": { |
@@ -5,10 +5,17 @@ # @cloudflare/unenv-preset | ||
unenv provides polyfills to add [Node.js](https://nodejs.org/) compatibility for any JavaScript runtime, including browsers and edge workers. | ||
## Usage | ||
```ts | ||
import { cloudflare, env, nodeless } from "@cloudflare/unenv-preset"; | ||
import { cloudflare } from "@cloudflare/unenv-preset"; | ||
import { defineEnv } from "unenv"; | ||
const { | ||
/* ... */ | ||
} = env(nodeless, cloudflare); | ||
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. |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
21
50%29631
-13.48%22
-4.35%1030
-15.92%