Socket
Book a DemoInstallSign in
Socket

@garfish/es-module

Package Overview
Dependencies
Maintainers
8
Versions
171
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@garfish/es-module

es module polyfill

latest
Source
npmnpm
Version
1.19.7
Version published
Maintainers
8
Created
Source

@garfish/es-module

NPM version

Inspired by virtual-es-module.

Usage

import Runtime from '@garfish/es-module';
// One runtime, one project
const runtime = new Runtime();

const module = await runtime.importByUrl('./a.mjs');
console.log(module);

const module = await runtime.importByCode(`
  import * as m from './a.mjs';
  export default 1;
`);
console.log(module);

Use in Garfish

@garfish/es-module will bring serious above-the-fold performance problems, child applications should not use esModule in production environments.

import { GarfishEsModule } from '@garfish/es-module';

Garfish.run({
  ...
  plugins: [
    ...
    GarfishEsModule({
      excludes: ['appName'],
    }),
  ],
})

Keywords

garfish

FAQs

Package last updated on 11 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts