# @wmfs/asl-choice-processor

> For determining the next state given an Amazon States Language 'Choices' definition and a set of values.

Latest version **1.26.0** (published 2026-10-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install @wmfs/asl-choice-processor
pnpm add @wmfs/asl-choice-processor
yarn add @wmfs/asl-choice-processor
bun add @wmfs/asl-choice-processor
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 1.26.0 |
| Published | 2026-10-30 |
| First published | 2018-06-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 81.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | West Midlands Fire Service |
| Maintainers | wmfsbot |
| Keywords | tymly, package, Amazon States Language |

## Links

- npm: https://www.npmjs.com/package/@wmfs/asl-choice-processor
- Repository: https://github.com/wmfs/asl-choice-processor
- Homepage: https://github.com/wmfs/asl-choice-processor#readme
- Issues: https://github.com/wmfs/asl-choice-processor/issues
- npm.io page: https://npm.io/package/@wmfs/asl-choice-processor

## Dependencies (2)

- [lodash](https://npm.io/package/lodash.md) 4.18.1
- [jsonpath](https://npm.io/package/jsonpath.md) 1.3.0

## Alternatives

- [monaco-yaml](https://npm.io/package/monaco-yaml.md) — 420.1K weekly downloads
- [@crewx/workflow](https://npm.io/package/@crewx/workflow.md) — 3.1K weekly downloads
- [yaml-cat](https://npm.io/package/yaml-cat.md) — 38 weekly downloads
- [nunjucks-in-yaml](https://npm.io/package/nunjucks-in-yaml.md) — 9 weekly downloads
- [shopify-symlinks](https://npm.io/package/shopify-symlinks.md) — 3 weekly downloads

## Recent versions

- 1.26.0 (latest) — 2026-10-30
- 1.25.1 — 2026-08-13
- 1.25.0 — 2025-10-21
- 1.24.1 — 2023-12-11
- 1.24.0 — 2022-09-15
- 1.23.0 — 2022-08-12
- 1.22.0 — 2021-05-11
- 1.21.0 — 2021-05-10
- 1.20.0 — 2021-05-10
- 1.19.0 — 2021-02-24
- 1.18.0 — 2021-01-19
- 1.17.0 — 2020-10-29
- 1.16.0 — 2020-08-17
- 1.15.0 — 2020-07-13
- 1.14.0 — 2019-09-09
- … 15 more at https://npm.io/package/@wmfs/asl-choice-processor/versions

## README

# asl-choice-processor
[![Tymly Package](https://img.shields.io/badge/tymly-package-blue.svg)](https://tymly.io/) [![npm (scoped)](https://img.shields.io/npm/v/@wmfs/asl-choice-processor.svg)](https://www.npmjs.com/package/@wmfs/asl-choice-processor) [![CircleCI](https://circleci.com/gh/wmfs/asl-choice-processor.svg?style=svg)](https://circleci.com/gh/wmfs/asl-choice-processor) [![codecov](https://codecov.io/gh/wmfs/asl-choice-processor/branch/master/graph/badge.svg)](https://codecov.io/gh/wmfs/asl-choice-processor) [![CodeFactor](https://www.codefactor.io/repository/github/wmfs/asl-choice-processor/badge)](https://www.codefactor.io/repository/github/wmfs/asl-choice-processor) [![Dependabot badge](https://img.shields.io/badge/Dependabot-active-brightgreen.svg)](https://dependabot.com/) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) [![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/wmfs/tymly/blob/master/packages/pg-concat/LICENSE)
> For determining the next state given an Amazon States Language "Choices" definition and a set of values. 

### Useful links

* [Amazon States Language specification (Apache License, Version 2.0)](https://states-language.net/spec.html#choice-state)
* [Choice](http://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-choice-state.html#amazon-states-language-choice-state-rules) state documentation

## <a name="install"></a>Install
```bash
$ npm install asl-choice-processor --save
```

## <a name="usage"></a>Usage
```javascript
const choiceProcessor = require('asl-choice-processor')
const calculateNextState = choiceProcessor(
  {
    Choices: [
      {
        Variable: '$.foo',
        NumericEquals: 1,
        Next: 'FirstMatchState'
      },
      {
        Variable: '$.foo',
        NumericEquals: 2,
        Next: 'SecondMatchState'
      }
    ],
    Default: 'DefaultMatchState'
  }
)

calculateNextState( {foo: 1} ) // FirstMatchState
calculateNextState( {foo: 2} ) // SecondMatchState
calculateNextState( {foo: 3} ) // DefaultMatchState
```

## <a name="tests"></a>Tests
```bash
$ npm test
```

## <a name="license"></a>License
[MIT](https://github.com/wmfs/tymly/packages/asl-choice-processor/blob/master/LICENSE)

---
_Source: https://npm.io/package/@wmfs/asl-choice-processor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
