Main<M extends Fn>(meta: Meta,main: M,): M
If the current module is the program entrypoint, runs the given main function as a separate task.
If the task throws, the error is logged and the process exits.
The exit code can be specified by the exitCode field of the
thrown exception. If not specified, it defaults to 1.
Example:
import { Main } from '@hackbg/fadroma'; export default Main(import.meta.main || import.meta.url, main) async function main (...args: string[]) { console.log('Program arguments:', ...args) }
M extends Fn