# maestra

> Get ready for an encore with this reprise to Octavia's concerto of mayhem.

Latest version **1.0.0** (published 2018-06-29) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-06-29 |
| First published | 2018-06-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Alexandre Breteau |
| Maintainers | seldszar |
| Keywords | dependencies, runner, sequencer, task |

## Links

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

## Recent versions

- 1.0.0 (latest) — 2018-06-29

## README

# Maestra

> Get ready for an encore with this reprise to Octavia's concerto of mayhem.

Another task manager & runner based on dependencies.

## Table of Contents

- [Installation](#installation)
- [Usage](#usage)
- [Author](#author)
- [License](#license)

## Installation

```bash
npm install maestra --save
```

## Usage

```javascript
const delay = require("delay");
const Maestra = require("maestra");

// Create a new maestra
const maestra = new Maestra();

// Add a task
maestra.add("lorem", [], () => {});

// Add a task depending of `lorem`
maestra.add("ipsum", ["lorem"], () => {});

// Add an task depending of `lorem`
maestra.add("dolor", ["lorem"], () => delay(3000));

// Add a task depending of `ipsum` & `dolor`
maestra.add("sit", ["ipsum", "dolor"], () => Promise.reject(new Error("Oof!")));

// Called when a task started
maestra.on("task-started", task => {
  console.log("[%s] started", task.name);
});

// Called when a task completed
maestra.on("task-completed", task => {
  console.log("[%s] completed", task.name);
});

// Called when a task failed
maestra.on("task-failed", (task, error) => {
  console.log("[%s] failed", task.name, error);
});

// Run the `ipsum` task and its dependencies
maestra.run(["ipsum"]).then(report => {
  // Report all tasks
  console.log('Task "ipsum" complete', report);

  // Reset the `ipsum` task
  maestra.reset(["ipsum"]);

  // Run all tasks
  maestra.run().catch(error => {
    // Reject if the report contains errors
    console.log("Oof!", error);
  });
});
```

## Author

Alexandre Breteau - [@0xSeldszar](https://twitter.com/0xSeldszar)

## License

MIT © [Alexandre Breteau](https://seldszar.fr)

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