Nocturnal Practitioners of Magic
    Wondering what’s next for npm?Check out our public roadmap! »

    create-require
    TypeScript icon, indicating that this package has built-in type declarations

    1.1.1 • Public • Published

    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

    Keywords

    none

    Install

    npm i create-require

    DownloadsWeekly Downloads

    3,981,675

    Version

    1.1.1

    License

    MIT

    Unpacked Size

    6.25 kB

    Total Files

    6

    Last publish

    Collaborators

    • avatar