ai-agent

Proposal Pattern Matching

Pattern matching syntax for ECMAScript
5,788 stars90 forksHTMLUpdated 10/5/2025100% free · open source
What it does

Proposal-pattern-matching allows you to use pattern matching syntax in ECMAScript, making it easier to handle complex data structures and conditional logic in your code

When to use it
  • When working with complex, nested data structures and you need to handle different cases based on the structure
  • When you want to simplify your code by replacing long chains of if-else statements with a more expressive and concise syntax
  • When you're working with functional programming concepts and need a more declarative way of handling data transformations
Ready-to-paste prompt
match ([x, y]) { case [1, 2] => console.log('matched [1, 2]'); case [3, 4] => console.log('matched [3, 4]'); case _ => console.log('default case'); }
Heads up: Make sure you're using a compatible version of Node.js (14 or higher) and Babel (7.10 or higher), as the proposal-pattern-matching syntax is not supported in older versions
Saves to your device
Use with Claude
New

Skip the builder — one click puts this in Claude, Cursor, Antigravity and more.

✅ Light setup

Installs with a command or two; your AI agent can do it for you.

Try it instantly — no install
Claude Code
mkdir -p ~/.claude/skills/proposal-pattern-matching && curl -fsSL https://workflowstacks.com/api/skills/proposal-pattern-matching/claude-skill -o ~/.claude/skills/proposal-pattern-matching/SKILL.md
Open in another AI app

Opens the app with this repo with the prompt ready to go — no copy-paste needed.

Connect the whole catalog (MCP)
claude mcp add --transport http workflowstacks https://workflowstacks.com/api/mcp

Adds a WorkflowStacks connector to Claude Code: search and load any skill here by chatting.

Quick Actions
Details
Creator
tc39
Language
HTML
Category
ai-agent
Published
7/3/2017

Are you the creator of this tool? Claim your listing → and earn 85% of every sale.