Skip to content

Commit

Permalink
added synopsis
Browse files Browse the repository at this point in the history
  • Loading branch information
fibo committed Oct 22, 2014
1 parent baa50bb commit 7c471d7
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion README.md
Expand Up @@ -4,6 +4,34 @@
[![NPM version](https://badge.fury.io/js/dflow.png)](http://badge.fury.io/js/dflow) [![Build Status](https://travis-ci.org/fibo/dflow.png?branch=master)](https://travis-ci.org/fibo/dflow.png?branch=master) [![Dependency Status](https://gemnasium.com/fibo/dflow.png)](https://gemnasium.com/fibo/dflow)

## Synopsis

```js
var dflow = require('dflow');

// A JSON that represents the execution graph.
var graph = {
"task": {
"1": { "func": "arguments[0]" },
"2": { "func": "console.log" }
},
"pipe": {
"3": { "from": "1", "to": "2", "arg": 0 }
}
};

// A collection of functions.
var funcs = {
'console.log': console.log.bind(console),
'+': function plus (a, b) { return a + b }
};

// Create a function
var f = dflow.func(funcs, graph);

f('Hello World'); // prints "Hello World"
```

For more information point your browser to [dflow Homepage](http://www.g14n.info/dflow).

## Installation
Expand All @@ -14,7 +42,7 @@ With [npm](https://npmjs.org/) do
$ npm install dflow
```

# License
## License

[MIT](http://www.g14n.info/mit-license)

0 comments on commit 7c471d7

Please sign in to comment.