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

1000.0.1 • Public • Published

main

Call a function when script is invoked directly (e.g. cli or subprocess).

require('main')(module, () => {
  /*
        [ code to run here ]
  */
})

The callback will NOT run if imported into another module.

Note: The variable module is required.

Install

npm i main --save

/main/

    Package Sidebar

    Install

    npm i main

    Weekly Downloads

    1,254

    Version

    1000.0.1

    License

    MIT

    Unpacked Size

    3 kB

    Total Files

    6

    Last publish

    Collaborators

    • querie.cc