# then-make

> The problem of callback hell is commonplace in node.js programs. If your storage is async and your logics is complex, then you hit the worst spot. Two popular solutions are promises and async.js. Unfortunately, your logics has complex branching patterns a

Latest version **0.0.2** (published 2015-05-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install then-make
pnpm add then-make
yarn add then-make
bun add then-make
```

## 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.2 |
| Published | 2015-05-09 |
| First published | 2015-05-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2660 |
| Author | Victor Grishchenko |
| Maintainers | gritzko |

## Links

- npm: https://www.npmjs.com/package/then-make
- Repository: https://github.com/gritzko/swarm
- Homepage: http://github.com/gritzko/swarm
- Issues: https://github.com/gritzko/swarm/issues
- npm.io page: https://npm.io/package/then-make

## Recent versions

- 0.0.2 (latest) — 2015-05-09
- 0.0.1 — 2015-05-08

## README

# Then-make it, no promises please

The problem of callback hell is commonplace in node.js programs. If
your storage is async and your logics is complex, then you hit the
worst spot. Two popular solutions are promises and async.js.
Unfortunately, your logics has complex branching patterns and neither
solution fits well. It is not a waterfall, unfortunately.
At some point, you understand that good old flowcharts and make files
express your logics much much better than either callbacks or
promises. OK, it is the case for then-make.

Then-make works in terms of *rules* and *targets*. You define rule
functions that produce target objectss. Rules are *reentrant*
functions that return their result either by `return result` or by a
`callback(err,result)`.  A rule may decide that it lacks a
prerequisite target, then it *yields*: `this.yield(target); return;`
(TODO generators). Once the prerequisite is produced, then-make will
invoke your rule once again.

Differently from classic makefiles, then-make rules decide on their
prereqisites at run time. So, you rule tells the system which other
prerequsites it needs *this time*.

For an example, see test.js.

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