Git Product home page Git Product logo

noflo-runtime-headless's Introduction

NoFlo headless runner

This utility enables proxying NoFlo postMessage runtimes running in a headless browser to the FBP protocol WebSocket transport.

The primary use case for this is enabling NoFlo browser components and applications to be tested with fbp-spec on the command-line (for example, inside a Continuous Integration system).

Requirements

You need a browser build of NoFlo and your components that exposes the noflo-runtime-postmessage library via window.require(). If you're building your libraries with grunt-noflo-browser, this will already be the case.

For custom builds, the easiest way to do this is by adding something like the following to your WebPack entry file:

const postMessageRuntime = require('noflo-runtime-postmessage');

const exported = {
  'noflo-runtime-postmessage': postMessageRuntime,
};

function requireModule(moduleName) {
  if (exported[moduleName]) {
    return exported[moduleName];
  }
  throw new Error(`Module ${moduleName} not available`);
}

if (window) {
  window.require = requireModule;
}

Running

Start the runtime with:

$ npx noflo-runtime-headless --file path/to/my/file.js

You can also let fbp-spec start the runtime for you:

$ npx fbp-spec --address ws://localhost:3569 --command \"noflo-runtime-headless -f path/to/my/file.js\" spec/*.yaml

Changes

  • 0.2.0 (Oct 13 2020)
    • Released with updated dependencies
  • 0.1.0 (Sep 23 2018)
    • Initial version

noflo-runtime-headless's People

Contributors

dependabot[bot] avatar bergie avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.