Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

node-module-polyfill

dmchurch2.3kISC1.0.1TypeScript support: included

Polyfills for the Node.Module interface

node.Module, createRequire, createRequireFromPath, require, polyfill

readme

node-module-polyfill Build Status Coverage Status

A polyfill for Node.Module.

Uses code from Node.js v12.11, tested back to v8.

Usage:

const Module = require("module");
require("node-module-polyfill");

or

import Module from 'module';
import 'node-module-polyfill';