How to use the noflo.ComponentLoader function in noflo

To help you get started, we’ve selected a few noflo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github noflo / dataflow-noflo / src / dataflow-noflo.js View on Github external
DataflowNoflo.registerGraph = function(graph) {
      // Plugin: library
      var cl = new noflo.ComponentLoader();
      cl.baseDir = graph.baseDir;
      cl.listComponents(function(types){
        for (name in types) {
          cl.load(name, function(component){
            makeDataflowNode(name, component);
          });
        }
      });
      // Might have to wait for the load callbacks
      dataflow.plugins.library.update({
        exclude: ["base", "base-resizable", "test", "noflo-base"]
      });

      // Plugin: source
      var sourceChanged = function(graph) {
        dataflow.plugins.source.show( JSON.stringify(graph.toJSON(), null, 2) );
github samtecspg / articulate / api / plugins / flow-loader.plugin.js View on Github external
exports.register = (server, options, next) => {

    const baseDir = options.baseDir;
    const rest = _.omit(options, 'baseDir');

    const loader = new NoFlo.ComponentLoader(baseDir, rest);
    loader.listComponents(() => {

        Object
            .keys(loader.components)
            .forEach((componentName) => {

                loader
                    .load(componentName, (err, component) => {

                        if (err) {
                            return next(err);
                        }
                        component
                            .start((err) => {

                                if (err) {
github noflo / noflo-react / spec / Render.js View on Github external
beforeEach(function(done) {
    this.timeout(10000);
    var loader = new noflo.ComponentLoader('/noflo-react');
    loader.load('react/Render', function(err, instance) {
      if (err) { return done(err); }
      c = instance;
      c.once('ready', function () {
        module = noflo.internalSocket.createSocket();
        container = noflo.internalSocket.createSocket();
        props = noflo.internalSocket.createSocket();
        event = noflo.internalSocket.createSocket();
        error = noflo.internalSocket.createSocket();
        c.inPorts.module.attach(module);
        c.inPorts.container.attach(container);
        c.inPorts.props.attach(props);
        c.outPorts.event.attach(event);
        c.outPorts.error.attach(error);
        c.start(done);
      });
github noflo / noflo-core / spec / mocha / Copy.js View on Github external
before(function (done) {
    this.timeout(4000);
    const loader = new noflo.ComponentLoader(baseDir);
    loader.load('core/Copy', (err, instance) => {
      if (err) {
        done(err);
        return;
      }
      c = instance;
      ins = noflo.internalSocket.createSocket();
      c.inPorts.in.attach(ins);
      done();
    });
  });
  beforeEach(() => {
github noflo / noflo-core / spec / mocha / ReadGlobal.js View on Github external
beforeEach(function (done) {
    this.timeout(4000);
    const loader = new noflo.ComponentLoader(baseDir);
    loader.load('core/ReadGlobal', (err, instance) => {
      if (err) {
        done(err);
        return;
      }
      c = instance;
      done();
    });
  });
github noflo / noflo-core / spec / mocha / Callback.js View on Github external
before(function (done) {
    this.timeout(4000);
    const loader = new noflo.ComponentLoader(baseDir);
    loader.load('core/Callback', (e, instance) => {
      if (e) {
        done(e);
        return;
      }
      c = instance;
      ins = noflo.internalSocket.createSocket();
      cb = noflo.internalSocket.createSocket();
      c.inPorts.in.attach(ins);
      c.inPorts.callback.attach(cb);
      done();
    });
  });
  beforeEach(() => {
github noflo / noflo-core / spec / mocha / Drop.js View on Github external
before(function (done) {
    this.timeout(4000);
    const loader = new noflo.ComponentLoader(baseDir);
    loader.load('core/Drop', (err, instance) => {
      if (err) {
        done(err);
        return;
      }
      c = instance;
      ins = noflo.internalSocket.createSocket();
      c.inPorts.in.attach(ins);
      done();
    });
  });
github noflo / noflo-core / spec / mocha / RunInterval.js View on Github external
before(function (done) {
    this.timeout(4000);
    const loader = new noflo.ComponentLoader(baseDir);
    loader.load('core/RunInterval', (err, instance) => {
      if (err) {
        done(err);
        return;
      }
      c = instance;
      interval = noflo.internalSocket.createSocket();
      c.inPorts.interval.attach(interval);
      start = noflo.internalSocket.createSocket();
      c.inPorts.start.attach(start);
      stop = noflo.internalSocket.createSocket();
      c.inPorts.stop.attach(stop);
      done();
    });
  });
  beforeEach(() => {
github noflo / noflo-core / spec / mocha / ReadEnv.js View on Github external
before(function (done) {
    this.timeout(4000);
    if (noflo.isBrowser()) {
      this.skip();
      return;
    }
    const loader = new noflo.ComponentLoader(baseDir);
    loader.load('core/ReadEnv', (e, instance) => {
      if (e) {
        done(err);
        return;
      }
      c = instance;
      key = noflo.internalSocket.createSocket();
      c.inPorts.key.attach(key);
      done();
    });
  });
  beforeEach(() => {
github noflo / noflo-core / spec / mocha / RunTimeout.js View on Github external
before(function (done) {
    this.timeout(4000);
    const loader = new noflo.ComponentLoader(baseDir);
    loader.load('core/RunTimeout', (err, instance) => {
      if (err) {
        done(err);
        return;
      }
      c = instance;
      start = noflo.internalSocket.createSocket();
      c.inPorts.start.attach(start);
      time = noflo.internalSocket.createSocket();
      c.inPorts.time.attach(time);
      done();
    });
  });
  beforeEach(() => {

noflo

Flow-Based Programming environment for JavaScript

MIT
Latest version published 3 years ago

Package Health Score

58 / 100
Full package analysis