This package has been deprecated

Author message:

deprecated

@bucuo/run-main

0.0.2 • Public • Published

Run Main

Run js main function.

Features

  • Run sync/async function
  • Exit after execution
  • Log uncaught error
  • Prepare intuitive command args

Install

npm install @bucuo/run-main

Usage

const runMain = require("@bucuo/run-main");

async function main(...args) {
  // ...
}

runMain(main);

API

async runMain(mainFn, options?)

  • mainFn: async function(...args)
  • options.logError?: function(error), default to console.error
  • options.forceExit?: boolean, default to `false

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i @bucuo/run-main

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

1.57 kB

Total Files

3

Last publish

Collaborators

  • zhaoyao91