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

rpgmasd-wasm

v3.2.3

Published

WASM bindings for rpgm-asset-decrypter-lib.

Readme

rpgmasd-wasm

WebAssembly bindings for rpgm-asset-decrypter-lib, generated via wasm-bindgen. A thin wrapper around the Rust reference implementation - useful when you want behavior guaranteed identical to the Rust crate without a second, hand-maintained implementation.

Install

npm install rpgmasd-wasm

API

The Decrypter class mirrors the Rust API directly (see src/lib.rs for full doc comments):

class Decrypter {
    constructor();
    key(): string | undefined;
    setKeyFromStr(key: string): void;
    setKeyFromFile(fileContent: Uint8Array, fileType: FileType): string;
    decrypt(fileContent: Uint8Array, fileType: FileType): Uint8Array;
    decryptInPlace(fileContent: Uint8Array, fileType: FileType): void;
    encrypt(fileContent: Uint8Array): Uint8Array;
    encryptInPlace(fileContent: Uint8Array): void;
}

plus the FileType enum (Png, Ogg, M4a) and free-function equivalents of the Rust crate's convenience wrappers - decryptAsset, decryptAssetInPlace, encryptAsset, encryptAssetInPlace - each spinning up a throwaway Decrypter internally, for one-shot calls that don't need to hold onto a key.

The *InPlace methods take a Uint8Array and mutate it: wasm-bindgen copies the array's bytes into WASM memory, runs the call, and copies the (possibly mutated) bytes back out afterward - so the mutation is visible on your own Uint8Array once the call returns, same as the reference in-place methods.

Usage

import init, { Decrypter, FileType } from "rpgmasd-wasm";

await init(); // instantiates the wasm module - do this once, before first use

const fileContent = new Uint8Array(await Deno.readFile("./image.rpgmvp"));

const decrypter = new Decrypter();
const decrypted = decrypter.decrypt(fileContent, FileType.Png); // key is auto-derived from the file

The free-function form is shorter when you don't need to reuse the derived key across multiple files:

import init, { decryptAsset, FileType } from "rpgmasd-wasm";

await init();
const decrypted = decryptAsset(fileContent, FileType.Png);

Under Node/Bun, init()'s default fetch()-based loading doesn't apply - pass the .wasm bytes explicitly instead:

import { readFile } from "node:fs/promises";
import init, { Decrypter } from "rpgmasd-wasm";

await init(
  await readFile(new URL("./rpgmasd_wasm_bg.wasm", import.meta.resolve("rpgmasd-wasm"))),
);

Building

wasm-pack build --release --target web

Requires the wasm32-unknown-unknown rustup target (rustup target add wasm32-unknown-unknown) and wasm-pack (cargo binstall wasm-pack). Output goes to pkg/ (gitignored): the compiled .wasm, a JS glue module, a .d.ts, and the package.json this crate publishes to npm from.