moonbit-js-binding

Installation
SKILL.md

MoonBit JS Binding Guide

Step-by-step workflow for binding JavaScript APIs (browser DOM, Node built-ins, npm packages) to MoonBit through the js backend.

When To Use

Use this skill when:

  • Adding extern "js" fn declarations for a JS API
  • Embedding inline JS (#| (x) => ...) or importing by module+name (= "Math" "max")
  • Configuring moon.pkg with link.js exports and format: esm/cjs/iife
  • Wrapping JS objects with #external pub type and %identity casts
  • Bridging Promises with async fn + %async.suspend + %async.run
  • Mapping undefined / null distinctly into MoonBit Option
  • Consuming npm packages via require(...) or ESM imports
  • Generating .d.ts for TypeScript consumers

Plan Mode Instructions

Installs
31
Repository
mizchi/skills
GitHub Stars
251
First Seen
Apr 27, 2026
moonbit-js-binding — mizchi/skills