1000.0.1 • Published 5 years ago

main v1000.0.1

Weekly downloads
123
License
MIT
Repository
-
Last release
5 years ago

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