This package has been deprecated

Author message:

Package deprecated. This package is so simple that you really should not depend on it. Feel free to copy the code into your projects.

supermain

0.0.2 • Public • Published

supermain

A wrapper for async functions that makes it easier to write simple node scripts using async/await.

API

supermain()

const supermain = require('supermain');

supermain(async () => {
  
  // something async in here

});

If the asynchronous function rejects, supermain will print the error stack to stderr and terminate the process with exit code 1.

supermain.makePromisesSafe()

const supermain = require('supermain').makePromisesSafe();

Calling .makePromisesSafe() triggers the same print-and-terminate behaviour on any unhandled rejection. Inspired by the fundamental make-promises-safe.

Compatibility

supermain works with both modern async functions from ES6 and functions that explicitely return Promises. Compatible with all Node.js versions >= 6.4.0.

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i supermain

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

3.28 kB

Total Files

6

Last publish

Collaborators

  • jacoscaz