# @gourmet/promise-main

> Handles the top main promise of a console app

Latest version **0.3.3** (published 2019-03-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @gourmet/promise-main
pnpm add @gourmet/promise-main
yarn add @gourmet/promise-main
bun add @gourmet/promise-main
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.3 |
| Published | 2019-03-13 |
| First published | 2018-04-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 45 |
| Maintainers | gourmet |

## Links

- npm: https://www.npmjs.com/package/@gourmet/promise-main
- Repository: https://github.com/gourmetjs/gourmet-ssr/tree/master/utils/promise-main
- npm.io page: https://npm.io/package/@gourmet/promise-main

## Recent versions

- 0.3.3 (latest) — 2019-03-13
- 0.3.2 — 2019-03-13
- 0.3.0 — 2019-01-12
- 0.2.0 — 2018-08-30
- 0.1.0 — 2018-04-23

## README

# @gourmet/promise-main

Handles the top main promise of a console app.

# Why?

Because all errors should be propagated properly to the top main promise and
there must be only one error handler in a console app.

# Basic usage

```js
const promiseMain = require("@gourmet/promise-main");

function main() {
  // ... main function of a console app that returns a promise ...
}

// Instead of this
/*
main().catch(err => {
  console.error(err);
  process.exit(1);
});
*/

// Do this
promiseMain(main());
```

---
_Source: https://npm.io/package/@gourmet/promise-main · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
