aoc/node_modules/create-require
alex ab688f8b38 solutions 2022-12-03 17:11:42 -05:00
..
CHANGELOG.md solutions 2022-12-03 17:11:42 -05:00
LICENSE solutions 2022-12-03 17:11:42 -05:00
README.md solutions 2022-12-03 17:11:42 -05:00
create-require.d.ts solutions 2022-12-03 17:11:42 -05:00
create-require.js solutions 2022-12-03 17:11:42 -05:00
package.json solutions 2022-12-03 17:11:42 -05:00

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