requireflow
v0.0.3
Published
🛡️🔄 Easily backfill the module.createRequire method for your Node.js project with this package!
Downloads
10
Readme
🔌👨💻 Need to polyfill Node.js
module.createRequire
(<= v12.2.0)? Look no further! This package provides a seamless solution for developers to ensure their code is fully supported across different Node.js versions. 🚀 Upgrade your development experience with ease using this polyfill package.
Install
# nyxi
nyxi requireflow
#pnpm
pnpm add requireflow
#npm
npm i requireflow
# yarn
yarn add requireflow
Usage
function createRequire(filename: string | URL): NodeRequire
const createRequire = require('requireflow')
const myRequire = createRequire('path/to/test.js')
const myModule = myRequire('./test-sibling-module')
License
MIT - Made with 💞