# seneca-await

> Use async and await with Seneca

Latest version **0.0.12** (published 2016-07-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install seneca-await
pnpm add seneca-await
yarn add seneca-await
bun add seneca-await
```

## 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.0.12 |
| Published | 2016-07-22 |
| First published | 2016-07-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Jeremy Wells |
| Maintainers | jemmyw |
| Keywords | seneca, await, async |

## Links

- npm: https://www.npmjs.com/package/seneca-await
- npm.io page: https://npm.io/package/seneca-await

## Dependencies (4)

- [seneca](https://npm.io/package/seneca.md) ^2.1.0
- [thunks](https://npm.io/package/thunks.md) ^4.2.2
- [bluebird](https://npm.io/package/bluebird.md) ^3.4.1
- [bluebird-co](https://npm.io/package/bluebird-co.md) ^2.1.2

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 0.0.12 (latest) — 2016-07-22
- 0.0.11 — 2016-07-12
- 0.0.10 — 2016-07-06
- 0.0.9 — 2016-07-05
- 0.0.8 — 2016-07-05
- 0.0.7 — 2016-07-04
- 0.0.6 — 2016-07-04
- 0.0.5 — 2016-07-04
- 0.0.4 — 2016-07-04
- 0.0.3 — 2016-07-03
- 0.0.2 — 2016-07-03
- 0.0.1 — 2016-07-03

## README

# Seneca Async

Use async / await methods with seneca.

## Install

```
npm install seneca-await
```

## Setup

You need to have babel to use await functions.

http://babeljs.io/docs/plugins/transform-async-to-module-method/

## Usage

```
import Seneca from 'seneca-await'

const seneca = Seneca()

async function addHello(msg) {
  return `Hello ${msg}`
}

seneca.add('role:test,cmd:sayhello', async function(msg) {
  const text = await addHello(msg.name)
  return {text: text}
})

async function start() {
  await seneca.ready()

  const response = await seneca.act('role:test,cmd:sayhello,name:Person')
  console.log(response.text) // => Hello Person
}

start()
```

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