Search code examples
javascriptnode.jsnoflo

Noflo custom components


I'm trying to build a working example using a custom component using noflo. Could somebody please explain how I should reference my component from within my .fbp file. The examples in the docs all seem to relate to npm based components.

Thanks


Solution

  • Assuming you have components/ComponentName.coffee (or .js), and this file is registered in package.json as

    noflo: {
      components: {
          "ComponentName": "components/ComponentName.coffee"
      }
    }
    

    then you should be able to refer to it in a .fbp file as

    'hello' -> IN node(ComponentName)
    

    or

    'hello' -> IN node(packagename/ComponentName)
    

    where packagename is the project name set in package.json.

    The declaration in the package.json can be automated using grunt-noflo-manifest.

    It is the same for noflo-browser, just with component.json instead of package.json