CoastalCommitsPastes/server/node_modules/create-require
2022-03-06 16:46:59 -08:00
..
CHANGELOG.md Initial commit 2022-03-06 16:46:59 -08:00
create-require.d.ts Initial commit 2022-03-06 16:46:59 -08:00
create-require.js Initial commit 2022-03-06 16:46:59 -08:00
LICENSE Initial commit 2022-03-06 16:46:59 -08:00
package.json Initial commit 2022-03-06 16:46:59 -08:00
README.md Initial commit 2022-03-06 16:46:59 -08: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