@cloudflare/unenv-preset
Advanced tools
Comparing version
{ | ||
"name": "@cloudflare/unenv-preset", | ||
"version": "0.0.0-773bda8b3", | ||
"version": "0.0.0-785c39153", | ||
"description": "cloudflare preset for unenv", | ||
@@ -27,23 +27,26 @@ "keywords": [ | ||
".": { | ||
"types": "./dist/src/index.d.ts", | ||
"import": "./dist/src/index.mjs" | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/index.mjs" | ||
}, | ||
"./runtime/*": { | ||
"types": "./dist/src/runtime/*.d.ts", | ||
"import": "./dist/src/runtime/*.mjs" | ||
} | ||
"./*": { | ||
"types": "./dist/runtime/*.d.mts", | ||
"default": "./dist/runtime/*.mjs" | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"main": "./dist/src/index.mjs", | ||
"types": "./dist/src/index.d.ts", | ||
"types": "./dist/index.d.ts", | ||
"files": [ | ||
"dist/src" | ||
"dist" | ||
], | ||
"devDependencies": { | ||
"@types/node": "*", | ||
"typescript": "~5.6.3", | ||
"unbuild": "^2.0.0" | ||
"@types/node-unenv": "npm:@types/node@^22.13.9", | ||
"typescript": "^5.7.2", | ||
"unbuild": "^3.2.0", | ||
"undici": "^5.28.5", | ||
"vitest": "~3.0.5", | ||
"wrangler": "0.0.0-785c39153" | ||
}, | ||
"peerDependencies": { | ||
"unenv": "npm:unenv-nightly@*", | ||
"workerd": "^1.20241216.0" | ||
"unenv": "2.0.0-rc.14", | ||
"workerd": "^1.20250124.0" | ||
}, | ||
@@ -64,4 +67,6 @@ "peerDependenciesMeta": { | ||
"check:lint": "eslint", | ||
"check:type": "tsc --noEmit" | ||
"check:type": "tsc --noEmit", | ||
"test:ci": "vitest run", | ||
"test:watch": "vitest" | ||
} | ||
} |
@@ -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. |
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
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
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%26871
-14.57%6
100%20
-9.09%941
-17.02%1
Infinity%