Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

main

querie.cc5.2kMIT1000.0.1TypeScript support: included

main entry point

main, entry point, entry-point

readme

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