New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

asl-puml

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asl-puml

Generates a plant uml file from a valid ASL file

  • 0.1.0
  • Source
  • npm
  • Socket score

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

asl-puml

license npm version

NPM

What does it do?

Generates a plantuml state diagram from a valid Amazon States Language file.

But why? There's already good tooling from AWS.

The existing tools are good but I'm looking for a simpler rendering that encodes a little more info than the AWS Toolkit.

I also do all of my development in an IDE and don't want to switch to the browser based AWS Workflow Studio.

Example step function

See __tests__/Definitions/demo.asl.json for the step function used for these examples.

The diagrams below show the same step function rendered by:

  • asl-puml (this library)
  • AWS Toolkit
  • AWS Workflow Studio

Feature comparison




Feature or Style
asl-pumlAWS ToolkitAWS Workflow Studio
renders the step function as a state diagramDiagram of the step function in the style of a PlantUML State Diagramshows state machine rendered by AWS Toolkit with generic rendering for every stateshows state machine in workflow studio with colors and icons
diagram matches the style seen in AWS Console for instance executionsnoyesno
renders the step function within Webstorm or other JetBrains productsyes, via the existing plantuml pluginno, not in AWS Toolkit for Webstormno
renders the step function within VS Codeyes, via the existing plantuml pluginyes, available in AWS Toolkit for VS Codeno
conveys the behavior for the stateyes, via colors and some iconsnoyes, very familiar AWS icons and colors.
avoid drawing duplicate paths to reduce clutter (catches)yesyesno, all paths are drawn
identify the compensate pathyes, albeit hard coded by state name regexnono
label the state transition if conditionalyes, limited support with StringEqualsnoyes, expression is shown in a note on the line
label the path from a catchyes, with line weight and colornopath is labeled with a Catch
label the path to a Fail stateyes, with line weight and colornono

Install

# Use via the CLI
npm install -g asl-puml
# Use in your code
npm install asl-puml

CLI

$ asl-puml --help

  Usage: asl-puml [options]

  Amazon States Language to PUML

  Options:

Amazon States Language to PUML

Options:
  -i --input <input>    path to input file
  -o --output <output>  path to output dir
  -h, --help            display help for command

Return status:

  • 0 if diagram was generated
  • 1 if there was an error

In your code

const aslPuml = require('asl-puml');
const definition = require('./path/to/my/state/machine/json/definition');
const { isValid, puml, message } = aslPuml(definition);
if (isValid) {
  console.log(puml)
} else {
  console.error(message);
}

Test

npm run test

Lint

npm run lint

See also

License

See LICENSE.

Keywords

FAQs

Package last updated on 29 Jun 2022

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