# toutsuite

> Runs a block of code with synchronously executing promises

Latest version **0.6.0** (published 2016-12-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install toutsuite
pnpm add toutsuite
yarn add toutsuite
bun add toutsuite
```

## 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.6.0 |
| Published | 2016-12-28 |
| First published | 2016-12-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Paul Betts |
| Maintainers | paulcbetts |
| Keywords | promise |

## Links

- npm: https://www.npmjs.com/package/toutsuite
- Repository: https://github.com/paulcbetts/toutsuite
- Homepage: https://github.com/paulcbetts/toutsuite#readme
- Issues: https://github.com/paulcbetts/toutsuite/issues
- npm.io page: https://npm.io/package/toutsuite

## Dependencies (2)

- [debug](https://npm.io/package/debug.md) ^2.5.1
- [synchronous-promise](https://npm.io/package/synchronous-promise.md) ^1.0.7

## Alternatives

- [promise-throttle](https://npm.io/package/promise-throttle.md) — 44.2K weekly downloads
- [@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

## Recent versions

- 0.6.0 (latest) — 2016-12-28
- 0.5.0 — 2016-12-23

## README

# toutsuite

Run your Promise code as synchronously as possible

This library attempts to make code written using Promises to run synchronously, kind of. 

### But how is that possible!

This library only works with code that doesn't actually use any real sources of asynchrony - i.e. code whose promises only are combinations of `then`, `resolve`, and `reject`. Any code that uses a real source of asynchrony (i.e. `setTimeout`, `fs.readFile`, etc etc) will _still_ run asynchronously. 

However, certain libraries like PostCSS for the most part are _not actually_ async, so this library will let you use it synchronously.

## Examples

```js
// Normally, Promise guarantees that it will be scheduled on the next tick
// (aka a "microtask")
let result = toutSuite(() => Promise.resolve(5).then((x) => x * 10));
console.log(result);
>>> 50
```

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