Skip to content
Omena
Integrations

NAPI and WASM

Select the published Node or browser binding without assuming repository-only exports.

Choose NAPI when a Node process can load a native package. Choose WASM when the host needs portable, in-memory execution. Both bindings expose semantic results, but their currently published versions do not have the same class surface.

Published NAPI

@omena/napi@0.2.1 exports JSON functions:

const { checkStyleSourceJson } = require("@omena/napi");

const result = JSON.parse(
  checkStyleSourceJson(".button { color: royalblue; }", "button.module.css"),
);

The repository's Node Workspace class is not in this package version.

Published WASM

@omena/wasm@0.3.0 is a bundler-target package and initializes during import:

import { Workspace } from "@omena/wasm";

const workspace = new Workspace("/workspace", [
  { stylePath: "button.module.css", styleSource: ".button {}" },
]);
const snapshot = workspace.snapshot();

WASM performs no filesystem discovery. Supply style sources, package manifests, and resolution inputs from the host. The browser playground demonstrates that constraint directly.

For the complete workflow contract, continue to SDK workflows.

On this page