Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

flowbject

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flowbject

Flowbject is a library that allows you to describe state machines with objects.

  • 1.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-84%
Maintainers
1
Weekly downloads
 
Created
Source

Flowbject

Flowbject allows you to build, validate and test your state-machine JSON in a more convenient way by interacting with Objects. This has many use-cases such as local state-flow validation, custom middlewares such as task identity resolvers, Tasks input/output mocking for flow-testing.

The concept is based on Amazon-State-Language.

Installation

npm install flowbject

Usage

Simple task build

import * as fobject from 'flowbject';


const stateMachine = new fobject.StateMachine();

const readImage = new fobject.Task('readImageFromS3')
    .setResource('arn::...');

const convertToThumbnail = new fobject.Task('convertToThumbnail')
    .setResource('arn::...');

const saveImage = new fobject.Task('saveToS3')
    .setResource('arn::...');

stateMachine
    .addState(readImage)
    .addState(convertToThumbnail)
    .addState(saveImage)
    .autoNextSetup(); // setup the tasks next-field automatically

const generator = new fobject.StepFunctionsGenerator();

const data = generator.generateStateMachine(stateMachine);

Output:

{
    "StartAt": "readImageFromS3",
    "States": {
        "readImageFromS3": {
            "Type": "Task",
            "Resource": "arn::...",
            "Next": "convertToThumbnail"
        },
        "convertToThumbnail": {
            "Type": "Task",
            "Resource": "arn::...",
            "Next": "saveToS3"
        },
        "saveToS3": {
            "Type": "Task",
            "Resource": "arn::...",
            "End": true
        }
    }
}

FAQs

Package last updated on 16 Mar 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc