mirror of https://github.com/MaxLeiter/Drift
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
208ba42c0e | 3 years ago | |
---|---|---|
.. | ||
CHANGELOG.md | 3 years ago | |
LICENSE | 3 years ago | |
README.md | 3 years ago | |
create-require.d.ts | 3 years ago | |
create-require.js | 3 years ago | |
package.json | 3 years ago |
README.md
create-require
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')