create-require
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

create-require

npm version npm downloads Github Actions Codecov

Polyfill for Node.js module.createRequire (<= v12.2.0)

Install

yarn add create-require
 
npm install create-require

Usage

function createRequire (filename: string | URL): NodeRequire;
const createRequire = require('create-require')
 
const myRequire = createRequire('path/to/test.js')
const myModule = myRequire('./test-sibling-module')

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.1
    17,176,270
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.1
    17,176,270
  • 1.1.0
    316
  • 1.0.2
    7,053
  • 1.0.1
    15
  • 1.0.0
    16
  • 0.0.1
    17
  • 0.0.0
    17

Package Sidebar

Install

npm i create-require

Weekly Downloads

17,183,704

Version

1.1.1

License

MIT

Unpacked Size

6.25 kB

Total Files

6

Last publish

Collaborators

  • pi0