# fbp-manifest

> Flow-Based Programming Manifest tools

Latest version **0.3.1** (published 2020-12-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install fbp-manifest
pnpm add fbp-manifest
yarn add fbp-manifest
bun add fbp-manifest
```

Provides the commands `fbp-manifest-deps`, `fbp-manifest-list`, `fbp-manifest-stats`, `fbp-manifest-validate`.

## 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.3.1 |
| Published | 2020-12-16 |
| First published | 2016-03-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 59.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Henri Bergius |
| Maintainers | bergie |

## Links

- npm: https://www.npmjs.com/package/fbp-manifest
- Repository: https://github.com/flowbased/fbp-manifest
- Homepage: https://github.com/flowbased/fbp-manifest#readme
- Issues: https://github.com/flowbased/fbp-manifest/issues
- npm.io page: https://npm.io/package/fbp-manifest

## Dependencies (4)

- [tv4](https://npm.io/package/tv4.md) ^1.2.7
- [clone](https://npm.io/package/clone.md) ^2.0.0
- [commander](https://npm.io/package/commander.md) ^6.1.0
- [fbp-graph](https://npm.io/package/fbp-graph.md) ^0.7.0

## Recent versions

- 0.3.1 (latest) — 2020-12-16
- 0.3.0 — 2020-12-16
- 0.2.7 — 2020-12-01
- 0.2.6 — 2020-09-23
- 0.2.5 — 2020-09-23
- 0.2.4 — 2020-09-17
- 0.2.3 — 2020-09-17
- 0.2.2 — 2020-09-17
- 0.2.1 — 2017-11-03
- 0.2.0 — 2017-10-27
- 0.1.14 — 2017-03-03
- 0.1.13 — 2017-01-24
- 0.1.12 — 2017-01-24
- 0.1.11 — 2017-01-03
- 0.1.10 — 2016-06-09
- … 10 more at https://npm.io/package/fbp-manifest/versions

## README

Flow-Based Programming Manifest Tools
=====================================

This repository provides a schema for Flow-Based Programming manifest (`fbp.json`) files, as well as tools for populating and validating them. The purpose of FBP manifest files is to provide a platform-agnostic registry of flow-based components available in a project.

Manifest files can be used by the FBP runtimes themselves for component loading, and is also useful for development tools like [Flowhub](https://flowhub.io) or [DrawFBP](https://github.com/jpaulm/drawfbp).

## Status

Used in production with NoFlo, both for Node.js and for [producing browser builds](https://github.com/noflo/noflo-component-loader).

## Tools

* `fbp-manifest-list`: Discover available components and list them
* `fbp-manifest-deps`: Produce a manifest consisting only of dependencies of a given component
* `fbp-manifest-stats`: Show component reuse statistics for a project
* `fbp-manifest-validate`: Validate a FBP manifest file against the schema

## Runtime support

FBP Manifest has been designed to have a plugin architecture where the developers of different flow-based runtimes can add support for their system. See [src/runtimes](https://github.com/flowbased/fbp-manifest/tree/master/src/runtimes) for how to do this. Runtimes can of course also just implement `fbp.json` generation and consumption on their own, and merely utilize the JSON schemas from this project to validate their structure.

Currently supported FBP runtimes are:

* [NoFlo](http://noflojs.org)
* [MsgFlo](https://github.com/msgflo/msgflo)

## Manifest structure

FBP manifests consist of the following information:

* `version`: version of the manifest specification, currently `1`
* `modules`: array of module definitions
* `main`: (optional) main component definition for running the project

The modules are objects with the following:

* `name`: name of the module
* `runtime`: runtime the module is for, for example `noflo-nodejs`
* `base`: base directory path of the module, relative to project root
* `components`: array of components contained in the module
* `description`: (optional) human-readable description for the module
* `icon`: (optional) default icon for components of the module, following [Font Awesome](http://fontawesome.io/icons/) naming conventions

Modules supporting multiple runtimes can appear multiple times in a manifest, once per each supported runtime. For example a NoFlo module that has some common components, and specific components for Node.js and browsers may have three entries with specific runtimes: `noflo`, `noflo-nodejs`, and `noflo-browser`. A manifest can contain modules for an arbitrary number of different runtimes.

Components are objects with the following:

* `name`: name of the component
* `path`: path used for executing the component. For example a Node.js require path or Java class path
* `exec`: command used for starting an instance of the component for components that are standalone processes
* `elementary`: boolean on whether the component is elementary (code) or not (graph)
* `source`: (optional) path to the source code of the component, in case it differs from the component path
* `tests`: (optional) path to the test suite of the component, typically pointing to a [fbp-spec](https://github.com/flowbased/fbp-spec) file
* `inports`: (optional) array of inport definitions for the component
* `outports`: (optional) array of outport definitions for the component

Each component needs to provide at minimum the information the runtime needs to run it. Additionally it can provide metadata usable for flow-based programming tools like a ports listing. Either `path` or `exec` needs to be provided.

The full manifest structure can be found in the [schema](https://github.com/flowbased/fbp-manifest/tree/master/schemata). Manifest files can be validated against the JSON schema or with the `fbp-manifest-validate` tool.

### Extending

It is possible to extend the manifest files with custom runtime-specific information. To do this, place the custom values under a key named after the runtime they're for. So, for example NoFlo's custom information about a component would go under a `noflo` key:

```json
{
  "name": "Merge",
  "path": "components/Merge.js",
  "source": "components/Merge.coffee",
  "elementary": true,
  "noflo": {
    "async": false
  }
}
```

## Background

* [FBP Protocol: component](http://noflojs.org/documentation/protocol/#component)
* [NoFlo issue 247: FBP project manifest](https://github.com/noflo/noflo/issues/247)
* [FBP Glossary](http://www.jpaulmorrison.com/fbp/gloss.htm)

## Changes

* 0.3.1 (2020-12-16)
  - The package now ships with TypeScript declarations
* 0.3.0 (2020-12-16)
  - Ported from callbacks to Promises
* 0.2.7 (2020-12-01)
  - TypeScript definition files (`.d.ts`) are not considered as components
* 0.2.6 (2020-09-23)
  - If there are multiple spec files for a module, the fbp-spec file will be used by fbp-manifest
* 0.2.5 (2020-09-23)
  - Added support for populating `tests` for each module
* 0.2.4 (2020-09-17)
  - Fixed a minor bug with collecting NoFlo graphs
* 0.2.2 (2020-09-17)
  - Added support for finding NoFlo TypeScript components

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