Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

flowx

Package Overview
Dependencies
Maintainers
2
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flowx

JSON based flow generator

latest
Source
npmnpm
Version
8.0.0
Version published
Maintainers
2
Created
Source

flowx

JSON based flow generator

Usage

Basic

'use strict'

const Flowx = require('flowx')

const data = {
  flow: "test1",
  states: [
    {
      name: "state1",
      transitions: [
        {
          name: "toState2",
          to: "state2"
        }
      ]
    },
    {
      name: "state2",
      transitions: [
        {
          name: "toState1",
          to: "state1"
        }
      ]
    }
  ]
}

const flow = new Flowx.Flow('myflow', data)

const instance = flow.newInstance(1)

instance.getState().then(function(state){
  console.log('State: ' + JSON.stringify(state.name))
})

instance.getState({action: 'toState2'}).then(function(state){
  console.log('State: ' + JSON.stringify(state.name))
})

FAQs

Package last updated on 29 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts