ai-agent

monet.js

Monet.js - Monadic types library for JavaScript
1,593 stars111 forksJavaScriptUpdated 11/19/2022100% free · open source
What it does

Adds functional monadic types like Maybe, Either, Validation, etc., to JavaScript so you can handle nulls and errors without try/catch.

When to use it
  • You need to safely chain operations on values that might be null/undefined.
  • You want explicit error handling without throwing exceptions.
  • You are building data pipelines where each step may fail and you want to keep the code readable.
Ready-to-paste prompt
```js
const { Maybe, Either } = require('monet');

function parseJson(str) {
  return Maybe.fromNull(str)
    .map(JSON.parse)                       // may throw – wrap in Try later if needed
    .cata(
      () => Either.left('invalid JSON'),
      obj => Either.right(obj)
    );
}

const payload = '{"age":30}';
const result = parseJson(payload)
  .flatMap(data => data.age >= 18 ? Either.right('adult') : Either.left('minor'));

result.cata(
  err => console.error('Error:', err),
  msg => console.log('Success:', msg)
);
```
Heads up: Monet.js relies on ES6 features; ensure your Node version is ≥6 or transpile with Babel if you target older environments.
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/monet-js && curl -fsSL https://workflowstacks.com/api/skills/monet-js/claude-skill -o ~/.claude/skills/monet-js/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
monet
Language
JavaScript
Category
ai-agent
Published
10/9/2013

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