Skip to content
data-flow-graph based tool to transform data
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
.eslintrc
.flowconfig
.gitignore
.travis.yml
LICENSE
README.md
index.js
package.json
test.js

README.md

paph

NPM version Travis Codecov

Data-flow-graph based tool to transform data.

Shortest path between initial and final is found before returning a combined function of all the transitions.

Built in protection against cycles.

Install

$ npm install --save paph

Usage

const paph = require('paph');

const store = paph();

// creating a relationship
store.add({start, end, weight?, transition});
             └─┬──┘      │        └┐
             String    Number   Function

// querying relationships
store.query(initial, final); // returns a function
               └──┬───┘
                String
const paph = require('paph');

const store = paph();

store.add({
    start: 'v1',
    end: 'v2',
    weight: 1,
    transition: (data) => {
        return data + '1,2 ';
    },
});

store.add({
    start: 'v2',
    end: 'v3',
    weight: 1,
    transition: (data) => {
        return data + '2,3 ' ;
    },
});

store.query('v1', 'v3')('');
//=> '1,2 2,3'
You can’t perform that action at this time.