A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/unjs/unenv below:

unjs/unenv: 🕊️ Node.js compatibility for any JavaScript runtime, including browsers and edge workers.

Note

You are on the development (v2) branch. Check out v1 for the current release.

unenv provides polyfills to add Node.js compatibility for any JavaScript runtime, including browsers and edge workers.

The defineEnv utility can generate a target environment configuration.

import { defineEnv } from "unenv";

const { env } = defineEnv({
  nodeCompat: true,
  npmShims: true,
  resolve: true,
  overrides: {},
  presets: [],
});

const { alias, inject, external, polyfill } = env;

You can then integrate the env object with your build tool:

You can also directly import unenv/ polyfills:

unenv replaces Node.js built-in modules compatible with any runtime (view source).

// Magic proxy to replace any unknown API
import MockProxy from "unenv/mock/proxy";

// You can also create named mocks
const lib = MockProxy.__createMock__("lib", {
  /* overrides */
});

(view source)

You can use the nightly release channel to try the latest changes in the main branch via unenv-nightly.

If directly using unenv in your project:

{
  "devDependencies": {
    "unenv": "npm:unenv-nightly"
  }
}

If using unenv via another tool (Nuxt or Nitro) in your project:

{
  "resolutions": {
    "unenv": "npm:unenv-nightly"
  }
}

Published under the MIT license. Made by @pi0 and community 💛

🤖 auto updated with automd


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4