Skip to content
/ paph Public

data-flow-graph based tool to transform data

License

Notifications You must be signed in to change notification settings

g-harel/paph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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'

About

data-flow-graph based tool to transform data

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published