# fruition

> Track execution paths and outcomes to form an explanation for understanding what happened

Latest version **0.2.2** (published 2023-11-02) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; no vulnerabilities; high quality score.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2023-11-02 |
| First published | 2023-09-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 14.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Perry Mitchell |
| Maintainers | perrymitchell |
| Keywords | executuion, path, explain, result, outcome, describe |

## Links

- npm: https://www.npmjs.com/package/fruition
- Repository: https://github.com/perry-mitchell/fruition
- Homepage: https://github.com/perry-mitchell/fruition#readme
- Issues: https://github.com/perry-mitchell/fruition/issues
- npm.io page: https://npm.io/package/fruition

## Dependencies (1)

- [columnify](https://npm.io/package/columnify.md) ^1.6.0

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 0.2.2 (latest) — 2023-11-02
- 0.2.1 — 2023-09-11
- 0.2.0 — 2023-09-10
- 0.1.0 — 2023-09-06

## README

# Fruition
> Track execution paths and outcomes to form an explanation for understanding what happened

## About

Fruition is a simple harness to record steps of execution by making "notes" (Nodes), which some of these being able to mark _branching_ or _measurements_. It outputs a handy string description so application flow debugging can be improved.

NodeJS v16 and up is supported. Types are provided.

## Usage

To get started, import the `Fruition` class:

```typescript
import { Fruition } from "fruition";

function someFlow(): [number, Fruition] {
    const fruition = new Fruition("some-flow");
    // <some functionality>
    fruition.mark("db lookups");
    // <some functionality>
    if (true) {
        fruition.branch("dev mode", {
            dev: true,
            code: 123
        });
    }
    // Done
    return [1, fruition];
}

// Later
const [result, trace] = someFlow();
console.log(trace.toString());
```

Flow can be improved by adding the `Realisation` class:

```typescript
import { Fruition, Realisation } from "fruition";

function someFlow(): Realisation<number> {
    const fruition = new Fruition("some-flow");
    // <snip>
    return new Realisation(1, fruition);
}

// Later
const realisation = someFlow();
console.log(trace.explain());

realisation.result // 1
realisation.trace // Fruition
```

_TBC_

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