npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@nemoir/compiler-wasm

v0.1.7

Published

Browser-callable compiler API as WebAssembly. Owns the worker-side bridge between the Monaco DSL editor and the NemoIR compiler stack.

Readme

@nemoir/compiler-wasm

Browser-callable NemoIR compiler as WebAssembly — the Worker-side bridge between the Monaco DSL editor and the NemoIR compiler stack.

What this package is

@nemoir/compiler-wasm wraps the NemoIR DSL and visual frontends, IR validator, and backend code generators in a single WebAssembly module. It exposes six typed entry points:

  • analyze(request) — parse, lower, and validate .nemo source; returns structured diagnostics and optionally the lowered IR.
  • generate(request) — run the full compiler pipeline and invoke a selected backend to produce downloadable source artifacts (Python package, web app, visualizer HTML).
  • metadata() — return compiler crate version, IR schema version, and the list of supported targets.
  • analyzeVisual(request) — validate and lower a visual semantic document (JSON) directly into shared IR; visual diagnostics carry phase: "visual" and a visualLocation instead of a source range.
  • generateVisual(request) — run the visual pipeline and invoke a selected backend to produce a downloadable artifact.
  • visualMetadata() — return the visual schema version and the capability catalogue used for tool-stage and policy validation.

All responses are plain JavaScript objects (no Map instances), so they are safe for structuredClone, JSON.stringify, and postMessage.

Installation

npm install @nemoir/compiler-wasm

Browser usage

import init, { analyze, generate, metadata } from "@nemoir/compiler-wasm";

await init(); // fetches and instantiates the WebAssembly module

const result = analyze({
  source: 'workflow Hello { stage @entry A { prompt:"hi" } }',
  filename: "workflow.nemo",
  includeIr: true,
});

console.log(result.ok);          // true
console.log(result.diagnostics); // []
console.log(result.ir);          // the validated WorkflowIr as a plain object

The package uses wasm-pack --target web, so the .wasm asset is loaded via fetch. For synchronous initialization (e.g. in a Worker with raw bytes), use initSync:

import { initSync, analyze } from "@nemoir/compiler-wasm";

const wasmBytes = await fetch("/nemoir_wasm_bg.wasm").then(r => r.arrayBuffer());
initSync(wasmBytes);

Targets

| Target | Output | |--------|--------| | none | Validated IR JSON (no artifact file) | | visualizer | Standalone workflow visualization HTML | | python | Installable Python package source tree | | web | Vite/TypeScript browser-app source tree |

Visual frontend

The visual entry points accept a parsed JSON semantic document (schemaVersion, workflow, states, controlEdges, dataEdges, policies) and lower it into the same shared WorkflowIr as the DSL frontend:

import { analyzeVisual } from "@nemoir/compiler-wasm";

const result = analyzeVisual({
  document: { schemaVersion: "0.1", workflow: { id: "Hello", inputs: [] }, /* ... */ },
  filename: "workflow.visual.json",
  includeIr: true,
});

The document is a semantic document only: it carries no canvas layout and is never serialized as .nemo source or interpreted as raw WorkflowIr. The full visual document shape is documented in the companion TypeScript declaration file (api.d.ts); the canonical public guide is the visual frontend guide.

API types

All request and response types are documented in the companion TypeScript declaration file. The canonical compiler semantics live in the NemoIR compiler docs, including the browser compiler guide.

Local development

Build this package from the compiler checkout root (the directory containing Cargo.toml):

rustup target add wasm32-unknown-unknown
wasm-pack build crates/nemoir-wasm --target web --release --scope nemoir
# The generated pkg/ directory is ready for local consumption.

For integrated development with the browser editor app, point its package.json at the generated pkg/ directory. In a NemoIR meta checkout, this path is relative to web/nemoir-compiler/package.json:

"@nemoir/compiler-wasm": "file:../../compiler/crates/nemoir-wasm/pkg"

See also web/nemoir-compiler/README.md for the full browser-application build instructions.

License

MIT