rangement/node_modules/create-require
2023-07-01 12:46:34 +02:00
..
CHANGELOG.md add packages and scripts in package.json 2023-07-01 12:46:34 +02:00
create-require.d.ts add packages and scripts in package.json 2023-07-01 12:46:34 +02:00
create-require.js add packages and scripts in package.json 2023-07-01 12:46:34 +02:00
LICENSE add packages and scripts in package.json 2023-07-01 12:46:34 +02:00
package.json add packages and scripts in package.json 2023-07-01 12:46:34 +02:00
README.md add packages and scripts in package.json 2023-07-01 12:46:34 +02:00

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