flow-text-component

0.2.6 • Public • Published

Flow Text component

A component for common operations on strings designed using Flow SDK.

To get started, install the package in your NodeJS project

npm i flow-text-component --save

Use the component as below

// require the component
const Component = require('flow-text-component');
 
// create instance of the Contains component for example
const component = new Component.Contains();

Provide required parameters

// these are required for the Contains component
component.getProperty('Text').data = 'Going forth into the deep.';
component.getProperty('Contains').data = 'for';

Then listen in for port emit events

component.getPort('Contains').onEmit(function() {
  // the text contains the other
});
 
component.getPort('DoesNotContain').onEmit(function() {
  // the text does not contain the other
});

Execute the component

// add the component to a graph before executing it
const Graph = require('flow-platform-sdk').Graph;
new Graph("graph-1").addComponent(component);
 
component.execute();

Conclusion

This is a sample use of the Flow Text component. Check the docs on how to use other components

Readme

Keywords

Package Sidebar

Install

npm i flow-text-component

Weekly Downloads

2

Version

0.2.6

License

Apache-2.0

Unpacked Size

57 kB

Total Files

30

Last publish

Collaborators

  • hackerbayadmin