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

@goplasmatic/reframe-wasm

v3.1.9

Published

WebAssembly bindings for Reframe transformation engine

Readme

reframe-wasm

WebAssembly bindings for Reframe - an enterprise-grade, bidirectional SWIFT MT ↔ ISO 20022 transformation service.

Features

  • Three Engine Architecture: Transform, Generate, and Validate engines matching Reframe's server architecture
  • Full Plugin Support: All SWIFT MT and MX message handling functions (parse_mt, parse_mx, validate_mt, validate_mx, generate_mt, generate_mx, publish_mt, publish_mx, detect)
  • Execution Tracing: Step-by-step debugging with *_with_trace methods for dataflow-ui integration
  • Promise-based API: All async operations return JavaScript Promises
  • Raw String Payloads: Payloads are passed as raw strings - parsing is handled by the parse plugins in workflows

Installation

npm install @goplasmatic/reframe-wasm

Quick Start

import init, { ReframeEngine } from '@goplasmatic/reframe-wasm';

// Initialize WASM module
await init();

// Load workflows (from your workflow package)
const workflows = {
  transform: [...transformWorkflows],
  generate: [...generateWorkflows],
  validate: [...validateWorkflows]
};
const engine = new ReframeEngine(JSON.stringify(workflows));

// Transform a SWIFT MT message to ISO 20022
// Payload is a raw string - parsing is done by the parse_mt plugin in the workflow
const mtMessage = "{1:F01BANKBEBBAXXX0000000000}{2:I103BANKDEFFXXXXN}{4:\n:20:REFERENCE123\n:23B:CRED\n:32A:230101EUR1000,00\n:50K:/12345678\nJOHN DOE\n:59:/87654321\nJANE DOE\n:71A:SHA\n-}";

const result = await engine.transform(mtMessage);
console.log(JSON.parse(result));

API Reference

ReframeEngine

The main engine class that wraps three dataflow-rs engines.

Constructor

constructor(workflows_json: string): ReframeEngine

Creates a new engine with the given workflows. Accepts either:

  • An object with transform, generate, validate keys (each an array of workflows)
  • A flat array of workflows (all go to transform engine)

Methods

| Method | Description | |--------|-------------| | transform(payload: string): Promise<string> | Transform a message (MT → MX or MX → MT) | | transform_with_trace(payload: string): Promise<string> | Transform with execution trace | | generate(payload: string): Promise<string> | Generate a sample message | | generate_with_trace(payload: string): Promise<string> | Generate with execution trace | | validate(payload: string): Promise<string> | Validate a message | | validate_with_trace(payload: string): Promise<string> | Validate with execution trace | | process(payload: string): Promise<string> | Alias for transform (dataflow-ui compatibility) | | process_with_trace(payload: string): Promise<string> | Alias for transform_with_trace | | get_workflows(): string | Get original workflow definitions | | workflow_count(): number | Get total workflow count | | transform_workflow_count(): number | Get transform workflow count | | generate_workflow_count(): number | Get generate workflow count | | validate_workflow_count(): number | Get validate workflow count | | workflow_ids(): string | Get workflow IDs as JSON | | function_names(): string | Get registered function names as JSON |

Standalone Functions

// One-off transformation
function transform_message(workflows_json: string, payload: string): Promise<string>;

// One-off validation
function validate_message(workflows_json: string, payload: string): Promise<string>;

// One-off generation
function generate_message(workflows_json: string, payload: string): Promise<string>;

Payload Handling

Important: All payloads are passed as raw strings. The parsing is handled by the parse plugins (parse_mt, parse_mx) in the workflows, not by the engine itself.

// MT message - raw string, parsed by parse_mt plugin
const mtMessage = "{1:F01BANKBEBBAXXX...}{2:I103...}{4:\n:20:REF\n-}";
await engine.transform(mtMessage);

// MX message - raw XML string, parsed by parse_mx plugin
const mxMessage = "<?xml version='1.0'?><Document>...</Document>";
await engine.transform(mxMessage);

Integration with dataflow-ui

The WASM library is designed to work with dataflow-ui for workflow visualization and debugging.

import { WorkflowVisualizer, DebuggerProvider, DataflowEngine } from '@goplasmatic/dataflow-ui';
import init, { ReframeEngine } from '@goplasmatic/reframe-wasm';

// Initialize WASM
await init();

// Create adapter implementing DataflowEngine interface
class ReframeEngineAdapter implements DataflowEngine {
  private engine: ReframeEngine;

  constructor(workflows: Workflow[]) {
    this.engine = new ReframeEngine(JSON.stringify({ transform: workflows }));
  }

  async processWithTrace(payload: string) {
    const result = await this.engine.process_with_trace(payload);
    return JSON.parse(result);
  }

  dispose() {
    this.engine.free();
  }
}

// Use in React component
function ReframeDebugView({ workflows }) {
  return (
    <DebuggerProvider engineFactory={(wfs) => new ReframeEngineAdapter(wfs)}>
      <WorkflowVisualizer workflows={workflows} debugMode={true} />
    </DebuggerProvider>
  );
}

Registered Functions

The following plugin functions are automatically registered:

| Function | Description | |----------|-------------| | detect | Generic payload detection and analysis | | parse_mt | Parse SWIFT MT message | | validate_mt | Validate SWIFT MT message | | generate_mt | Generate SWIFT MT message | | publish_mt | Format SWIFT MT message for output | | parse_mx | Parse ISO 20022 MX message | | validate_mx | Validate ISO 20022 MX message | | generate_mx | Generate ISO 20022 MX message | | publish_mx | Format ISO 20022 MX message for output |

Building from Source

Prerequisites

  • Rust 1.87+ (edition 2024)
  • wasm-pack (cargo install wasm-pack)

Build

cd wasm
wasm-pack build --target web --out-dir pkg

Test

wasm-pack test --headless --chrome

Publish

./publish.sh
cd pkg && npm publish --access public

Local Development

To use local versions of dependencies during development, uncomment the patch section in Cargo.toml:

[patch.crates-io]
swift-mt-message = { path = "../../SwiftMTMessage" }
mx-message = { path = "../../MXMessage" }
dataflow-rs = { path = "../../dataflow-rs" }
datalogic-rs = { path = "../../datalogic-rs" }

License

Apache-2.0

Related Projects