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

java-remapper

v1.0.6

Published

A JavaScript tool for remapping Java classes.

Readme

🔖 java-remapper

A lightweight JavaScript/TypeScript tool for parsing and applying Java class mappings. It supports multiple mapping formats and allows remapping of Java .class files in the browser or Node.js.


Features

  • Supports multiple mapping formats:
    • SRG/XSRG
    • CSRG/TSRG
    • TSRG v2
    • ProGuard
    • Tiny v1
    • Tiny v2
  • Automatic format detection based on file content
  • Remap .class files from obfuscated to deobfuscated names using mappings
  • Works in Node.js and browser environments

Installation

npm install java-remapper

Usage

1. Detect mapping format

import { detectMappingFormat } from "java-remapper";

const content = `
tiny\t2\t0\tnamed
c\texample/ClassName\tcom/example/MyClass
`;
const format = detectMappingFormat(content);
console.log(format); // Output: MappingFormat.TINY2

2. Parse mappings

import { parseMappings, MappingFormat } from "java-remapper";

const mappingsContent = "..."; // Mapping file content
const mappings = parseMappings(MappingFormat.TINY2, mappingsContent);

3. Remap .class files

import { remap } from "java-remapper";
import fs from "fs";

const classBytes = fs.readFileSync("Example.class");
const newBytes = await remap(classBytes, mappings);
fs.writeFileSync("ExampleRemapped.class", newBytes);

4. Types

import { MappingSet } from "java-remapper";

🛠 API

detectMappingFormat(content: string): MappingFormat | null

Detects the mapping format from content.

parseMappings(format: MappingFormat, content: string): MappingSet

Parses a mapping file into a MappingSet.

remap(b: Uint8Array, mappings: MappingSet): Promise<Uint8Array>

Remaps a Java .class file byte array using the given mappings.


Notes

  • This library only remaps Java class files, not full JARs. To handle JARs, extract .class files, remap them individually, and repackage.
  • Ensure mappings and class files match the same version of obfuscation/deobfuscation.

License

This project is licensed under the MIT License.