You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
juncheng.li 27cf5ae2d3 add modules 1 year ago
..
CHANGELOG.md add modules 1 year ago
LICENSE add modules 1 year ago
README.md add modules 1 year ago
create-require.d.ts add modules 1 year ago
create-require.js add modules 1 year ago
package.json add modules 1 year ago

README.md

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