npm install
latest dependency treenpm shrinkwrap
to generate initialnpmshrinkwrap.json
file- In
npmshrinkwrap.json
find all occurances of"noflo"
and replace the contents with e.g.
// ...
package pipeline | |
import fmt | |
// pipeline allows chaining simple calls in tests | |
type pipeline struct { | |
err error | |
} | |
// ok asserts that a function does not return an error |
assembly = require '../lib/assembly' | |
class DbInsert extends assembly.Component | |
description: 'Inserts a database record' | |
# Validation of the input message is done automatically | |
# before relay() method is entered | |
validates: | |
'db': 'func' # expect a constructor function | |
'query.table': 'ok' # expect something truthy | |
'query.data': 'obj' # expect an object |
process: (input, output) -> | |
# Drop brackets | |
if input.ip.type isnt 'data' | |
buf = if input.scope isnt null then input.port.scopedBuffer[input.scope] else input.port.buffer | |
return buf.pop() | |
# Then do whatever you want with data packets, e.g. | |
data = input.getData 'foo' |
noflo = require 'noflo' | |
parser = require 'js-yaml' | |
exports.getComponent = -> | |
c = new noflo.Component | |
c.description = 'Parse YAML to an object' | |
c.inPorts.add 'in', | |
datatype: 'string' | |
description: 'YAML source' | |
c.outPorts.add 'out', |
c = new noflo.Component | |
inPorts: | |
streamy: | |
datatype: 'object' | |
description: 'Substreams' | |
inty: | |
datatype: 'int' | |
description: 'Scalar' | |
outPorts: | |
result: |
c = new noflo.Component | |
c.desciption = 'A component that posts on behalf of user' | |
c.inPorts = new noflo.InPorts | |
db: | |
datatype: 'object' | |
control: true | |
user: | |
datatype: 'object' | |
post: | |
datatype: 'object' |
c = new noflo.Component | |
c.desciption = 'A component that posts on behalf of user' | |
c.inPorts = new noflo.InPorts | |
timeout: | |
datatype: 'int' | |
control: true | |
user: | |
datatype: 'object' | |
post: | |
datatype: 'object' |
noflo = require 'noflo' | |
chai = require 'chai' | |
uuid = require 'uuid' | |
db = require '../lib/db' | |
Tester = require 'noflo-tester' | |
describe 'SomeComponent', -> | |
c = new Tester 'some-project/SomeComponent' | |
productData = | |
id: uuid.v4() |
var noflo = require("noflo"); | |
exports.getComponent = function() { | |
var component = new noflo.Component; | |
component.description = "Test"; | |
component.inPorts.add('in', { | |
datatype: 'all', | |
addressable: true | |
}); |