step-function
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

Allows you to orchestrate functions as a series of steps in a workflow

Usage example

import { Machine } from "./Machine"
import { State } from "./State"

const goodbyeStep = State.create<string, void>({
    name: "Goodbye",
    resource: (name) => {
        console.log(`Goodbye ${name}`)
    }
})

const helloStep = State.create<string, string>({
    name: "Hello",
    resource: (name) => {
        console.log(`Hello ${name}`)
        return name
    },
    next: goodbyeStep.name
})

const machine = Machine.create({
    description: "Hello Machine",
    startAt: helloStep.name,
    states: [helloStep, goodbyeStep]
})

const response = machine.run('MininoxD')

response.then((result) => {
    console.log(result)
})

Package Sidebar

Install

npm i step-function

Weekly Downloads

0

Version

1.0.5

License

GPL-3.0

Unpacked Size

50.9 kB

Total Files

17

Last publish

Collaborators

  • minino