unenv-nightly
Advanced tools
Comparing version 1.9.1-1716980128.bd69b52 to 1.9.1-1716985072.70cff12
{ | ||
"name": "unenv-nightly", | ||
"version": "1.9.1-1716980128.bd69b52", | ||
"version": "1.9.1-1716985072.70cff12", | ||
"description": "", | ||
@@ -31,3 +31,3 @@ "repository": "unjs/unenv", | ||
"lint": "eslint . && prettier -c src test", | ||
"lint:fix": "eslint --fix . && prettier -w src test", | ||
"lint:fix": "automd && eslint --fix . && prettier -w src test", | ||
"prepack": "unbuild", | ||
@@ -51,2 +51,3 @@ "release": "pnpm test && changelogen --release && pnpm publish && git push --follow-tags", | ||
"@types/node": "^20.12.12", | ||
"automd": "^0.3.7", | ||
"changelogen": "^0.5.5", | ||
@@ -62,2 +63,2 @@ "eslint": "^9.3.0", | ||
"packageManager": "pnpm@9.1.2" | ||
} | ||
} |
123
README.md
# unenv | ||
`unenv` is a framework-agnostic system that allows converting JavaScript code to be platform agnostic and work in any environment including Browsers, Workers, Node.js, or JavaScript runtime. | ||
<!-- automd:badges color=yellow packagephobia --> | ||
[![npm version](https://img.shields.io/npm/v/unenv?color=yellow)](https://npmjs.com/package/unenv) | ||
[![npm downloads](https://img.shields.io/npm/dm/unenv?color=yellow)](https://npmjs.com/package/unenv) | ||
<!-- /automd --> | ||
unenv provides a collection of Node.js and Web polyfills and mocking utilities with configurable presets for converting JavaScript code and libraries to be platform and runtime agnostic, working in any environment including Browsers, Workers, Node.js, Cloudflare Workers, Deno. | ||
Unenv is used by [Nitro](https://nitro.unjs.io/) and [Nuxt](https://nuxt.com/) today. | ||
## Install | ||
```bash | ||
# Using npm | ||
npm i -D unenv | ||
<!-- automd:pm-i dev --> | ||
# Using yarn | ||
yarn add --dev unenv | ||
```sh | ||
# ✨ Auto-detect | ||
npx nypm install -D unenv | ||
# Using pnpm | ||
pnpm add -D unenv | ||
# npm | ||
npm install -D unenv | ||
# yarn | ||
yarn add -D unenv | ||
# pnpm | ||
pnpm install -D unenv | ||
# bun | ||
bun install -D unenv | ||
``` | ||
<!-- /automd --> | ||
## Usage | ||
Using `env` utility and built-in presets, `unenv` will provide an abstract configuration that can be used in building pipelines ([rollup.js](https://rollupjs.org), [webpack](https://webpack.js.org), etc.). | ||
Using `env` utility and built-in presets, `unenv` will provide an abstract configuration that can be used in bundlers ([rollup.js](https://rollupjs.org), [webpack](https://webpack.js.org), etc.). | ||
@@ -107,54 +126,5 @@ ```js | ||
`unenv` provides a replacement for all Node.js built-ins for cross-platform compatibility. | ||
`unenv` provides a replacement for Node.js built-in modules compatible with any runtime. | ||
| Module | Status | Source | | ||
| --------------------------------------------------------------------------- | ---------- | ------------------------------------------------------------------ | | ||
| [node:assert](https://nodejs.org/api/assert.html) | Mocked | - | | ||
| [node:async_hooks](https://nodejs.org/api/async_hooks.html) | Polyfilled | [unenv/node/async_hooks](./src/runtime/node/async_hooks) | | ||
| [node:buffer](https://nodejs.org/api/buffer.html) | Polyfilled | [unenv/node/buffer](./src/runtime/node/buffer) | | ||
| [node:child_process](https://nodejs.org/api/child_process.html) | Mocked | - | | ||
| [node:cluster](https://nodejs.org/api/cluster.html) | Mocked | - | | ||
| [node:console](https://nodejs.org/api/console.html) | Mocked | - | | ||
| [node:constants](https://nodejs.org/api/constants.html) | Mocked | - | | ||
| [node:crypto](https://nodejs.org/api/crypto.html) | Polyfilled | [unenv/node/crypto](./src/runtime/node/crypto) | | ||
| [node:dgram](https://nodejs.org/api/dgram.html) | Mocked | - | | ||
| [node:diagnostics_channel](https://nodejs.org/api/diagnostics_channel.html) | Mocked | - | | ||
| [node:dns](https://nodejs.org/api/dns.html) | Mocked | - | | ||
| [node:domain](https://nodejs.org/api/domain.html) | Mocked | - | | ||
| [node:events](https://nodejs.org/api/events.html) | Polyfilled | [unenv/node/events](./src/runtime/node/events) | | ||
| [node:fs](https://nodejs.org/api/fs.html) | Polyfilled | [unenv/node/fs](./src/runtime/node/fs) | | ||
| [node:fs/promises](https://nodejs.org/api/fs/promises.html) | Polyfilled | [unenv/node/fs/promises](./src/runtime/node/fs/promises) | | ||
| [node:http2](https://nodejs.org/api/http2.html) | Mocked | - | | ||
| [node:http](https://nodejs.org/api/http.html) | Polyfilled | [unenv/node/http](./src/runtime/node/http) | | ||
| [node:https](https://nodejs.org/api/https.html) | Polyfilled | [unenv/node/https](./src/runtime/node/https) | | ||
| [node:inspector](https://nodejs.org/api/inspector.html) | Mocked | - | | ||
| [node:module](https://nodejs.org/api/module.html) | Polyfilled | [unenv/node/module](./src/runtime/node/module) - | | ||
| [node:net](https://nodejs.org/api/net.html) | Polyfilled | [unenv/node/net](./src/runtime/node/net) | | ||
| [node:os](https://nodejs.org/api/os.html) | Mocked | - | | ||
| [node:path](https://nodejs.org/api/path.html) | Polyfilled | [unenv/node/path](./src/runtime/node/path) | | ||
| [node:perf_hooks](https://nodejs.org/api/perf_hooks.html) | Mocked | - | | ||
| [node:process](https://nodejs.org/api/process.html) | Polyfilled | [unenv/node/process](./src/runtime/node/process) | | ||
| [node:punycode](https://nodejs.org/api/punycode.html) | Mocked | - | | ||
| [node:querystring](https://nodejs.org/api/querystring.html) | Mocked | - | | ||
| [node:readline](https://nodejs.org/api/readline.html) | Mocked | - | | ||
| [node:repl](https://nodejs.org/api/repl.html) | Mocked | - | | ||
| [node:stream](https://nodejs.org/api/stream.html) | Polyfilled | [unenv/node/stream](./src/runtime/node/stream) | | ||
| [node:stream/consumers](https://nodejs.org/api/stream.html) | Mocked | [unenv/node/stream/consumers](./src/runtime/node/stream/consumers) | | ||
| [node:stream/promises](https://nodejs.org/api/stream.html) | Mocked | [unenv/node/stream/promises](./src/runtime/node/stream/promises) | | ||
| [node:stream/web](https://nodejs.org/api/stream.html) | Native | [unenv/node/stream/web](./src/runtime/node/stream/web) | | ||
| [node:string_decoder](https://nodejs.org/api/string_decoder.html) | Polyfilled | [unenv/node/string_decoder](./src/runtime/node/string_decoder) | | ||
| [node:sys](https://nodejs.org/api/sys.html) | Mocked | - | | ||
| [node:timers](https://nodejs.org/api/timers.html) | Mocked | - | | ||
| [node:timers/promises](https://nodejs.org/api/timers.html) | Mocked | - | | ||
| [node:tls](https://nodejs.org/api/tls.html) | Mocked | - | | ||
| [node:trace_events](https://nodejs.org/api/trace_events.html) | Mocked | - | | ||
| [node:tty](https://nodejs.org/api/tty.html) | Mocked | - | | ||
| [node:url](https://nodejs.org/api/url.html) | Polyfilled | [unenv/node/url](./src/runtime/node/url) | | ||
| [node:util](https://nodejs.org/api/util.html) | Polyfilled | [unenv/node/util](./src/runtime/node/util) | | ||
| [node:util/types](https://nodejs.org/api/util.html) | Polyfilled | [unenv/node/util/types](./src/runtime/node/util/types) | | ||
| [node:v8](https://nodejs.org/api/v8.html) | Mocked | - | | ||
| [node:vm](https://nodejs.org/api/vm.html) | Mocked | - | | ||
| [node:wasi](https://nodejs.org/api/wasi.html) | Mocked | - | | ||
| [node:worker_threads](https://nodejs.org/api/worker_threads.html) | Mocked | - | | ||
| [node:zlib](https://nodejs.org/api/zlib.html) | Mocked | - | | ||
[(view source)](./src/runtime/node) | ||
@@ -165,15 +135,5 @@ ## npm packages | ||
| Package | Status | Source | | ||
| ----------------------------------------------------------- | --------------------------- | ----------------------------------------------------------------- | | ||
| [npm/consola](https://www.npmjs.com/package/consola) | Use native `console` | [unenv/runtime/npm/consola](./src/runtime/npm/consola.ts) | | ||
| [npm/cross-fetch](https://www.npmjs.com/package/node-fetch) | Use native `fetch` | [unenv/runtime/npm/cross-fetch](./src/runtime/npm/cross-fetch.ts) | | ||
| [npm/debug](https://www.npmjs.com/package/debug) | Mocked with `console.debug` | [unenv/runtime/npm/debug](./src/runtime/npm/debug.ts) | | ||
| [npm/fsevents](https://www.npmjs.com/package/fsevents) | Mocked | [unenv/runtime/npm/fsevents](./src/runtime/npm/fsevents.ts) | | ||
| [npm/inherits](https://www.npmjs.com/package/inherits) | Inlined | [unenv/runtime/npm/inherits](./src/runtime/npm/inherits.ts) | | ||
| [npm/mime-db](https://www.npmjs.com/package/mime-db) | Minimized | [unenv/runtime/npm/mime-db](./src/runtime/npm/mime-db.ts) | | ||
| [npm/mime](https://www.npmjs.com/package/mime) | Minimized | [unenv/runtime/npm/mime](./src/runtime/npm/mime.ts) | | ||
| [npm/node-fetch](https://www.npmjs.com/package/node-fetch) | Use native `fetch` | [unenv/runtime/npm/node-fetch](./src/runtime/npm/node-fetch.ts) | | ||
| [npm/whatwg-url](https://www.npmjs.com/package/whatwg-url) | Use native `URL` | [unenv/runtime/npm/whatwg-url](./src/runtime/npm/whatwg-url.ts) | | ||
[(view source)](./src/runtime/npm) | ||
## Auto-mocking proxy | ||
## Mocking utils | ||
@@ -230,2 +190,19 @@ ```js | ||
MIT | ||
<!-- automd:contributors license=MIT author=pi0 --> | ||
Published under the [MIT](https://github.com/unjs/unenv/blob/main/LICENSE) license. | ||
Made by [@pi0](https://github.com/pi0) and [community](https://github.com/unjs/unenv/graphs/contributors) 💛 | ||
<br><br> | ||
<a href="https://github.com/unjs/unenv/graphs/contributors"> | ||
<img src="https://contrib.rocks/image?repo=unjs/unenv" /> | ||
</a> | ||
<!-- /automd --> | ||
<!-- automd:with-automd --> | ||
--- | ||
_🤖 auto updated with [automd](https://automd.unjs.io)_ | ||
<!-- /automd --> |
@@ -10,4 +10,4 @@ type ConsolaUtils = typeof import("consola/utils"); | ||
export declare const centerAlign: ConsolaUtils["centerAlign"]; | ||
export declare const colors: Record<"reset" | "bold" | "dim" | "italic" | "underline" | "inverse" | "hidden" | "strikethrough" | "black" | "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white" | "gray" | "bgBlack" | "bgRed" | "bgGreen" | "bgYellow" | "bgBlue" | "bgMagenta" | "bgCyan" | "bgWhite" | "blackBright" | "redBright" | "greenBright" | "yellowBright" | "blueBright" | "magentaBright" | "cyanBright" | "whiteBright" | "bgBlackBright" | "bgRedBright" | "bgGreenBright" | "bgYellowBright" | "bgBlueBright" | "bgMagentaBright" | "bgCyanBright" | "bgWhiteBright", import("consola/utils").ColorFunction>; | ||
export declare const colors: Record<"bold" | "reset" | "dim" | "italic" | "underline" | "inverse" | "hidden" | "strikethrough" | "black" | "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white" | "gray" | "bgBlack" | "bgRed" | "bgGreen" | "bgYellow" | "bgBlue" | "bgMagenta" | "bgCyan" | "bgWhite" | "blackBright" | "redBright" | "greenBright" | "yellowBright" | "blueBright" | "magentaBright" | "cyanBright" | "whiteBright" | "bgBlackBright" | "bgRedBright" | "bgGreenBright" | "bgYellowBright" | "bgBlueBright" | "bgMagentaBright" | "bgCyanBright" | "bgWhiteBright", import("consola/utils").ColorFunction>; | ||
declare const _default: typeof import("consola/utils"); | ||
export default _default; |
@@ -5,3 +5,3 @@ export declare const _supportedEntryTypes: readonly ["event", "mark", "measure", "resource"]; | ||
readonly __unenv__ = true; | ||
detail: any; | ||
detail: any | undefined; | ||
entryType: _PerformanceEntryType; | ||
@@ -22,11 +22,11 @@ name: string; | ||
export declare class _PerformanceMark extends _PerformanceEntry implements globalThis.PerformanceMark { | ||
entryType: _PerformanceEntryType; | ||
entryType: "mark"; | ||
} | ||
export declare const PerformanceMark: typeof globalThis.PerformanceMark; | ||
export declare class _PerformanceMeasure extends _PerformanceEntry implements globalThis.PerformanceMeasure { | ||
entryType: _PerformanceEntryType; | ||
entryType: "measure"; | ||
} | ||
export declare const PerformanceMeasure: typeof globalThis.PerformanceMeasure; | ||
export declare class _PerformanceResourceTiming extends _PerformanceEntry implements globalThis.PerformanceResourceTiming { | ||
entryType: _PerformanceEntryType; | ||
entryType: "resource"; | ||
serverTiming: readonly PerformanceServerTiming[]; | ||
@@ -33,0 +33,0 @@ connectEnd: number; |
@@ -1,2 +0,2 @@ | ||
export declare class _Performance implements globalThis.Performance { | ||
export declare class _Performance<PerformanceEntryT extends PerformanceEntry = PerformanceEntry> implements globalThis.Performance { | ||
readonly __unenv__ = true; | ||
@@ -14,5 +14,5 @@ timeOrigin: number; | ||
clearResourceTimings(): void; | ||
getEntries(): PerformanceEntry[]; | ||
getEntriesByName(name: string, type?: string | undefined): PerformanceEntry[]; | ||
getEntriesByType(type: string): PerformanceEntry[]; | ||
getEntries(): PerformanceEntryT[]; | ||
getEntriesByName(name: string, type?: string | undefined): PerformanceEntryT[]; | ||
getEntriesByType(type: string): PerformanceEntryT[]; | ||
mark(name: string, options?: PerformanceMarkOptions | undefined): PerformanceMark; | ||
@@ -19,0 +19,0 @@ measure(measureName: string, startOrMeasureOptions?: string | PerformanceMeasureOptions, endMark?: string): PerformanceMeasure; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
579818
327
16913
10
206