jd-core-js
v0.0.2
Published
A pure JavaScript port of jd-core
Readme
jd-core-js
A pure JavaScript port of jd-core.
Inspect Java archives and decompile class files in the browser.
Playground
Try it: jd-core-js Playground
Note
This repository carefully verifies porting compatibility to ensure E2E compatibility, but does not place much emphasis on code quality. There are also no plans to maintain it seriously going forward. (Pull requests may be reviewed depending on their content, but please do not expect a response.)
Usage
Import ClassFileToJavaSourceDecompiler and provide synchronous Loader and Printer implementations.
import {
ClassFileToJavaSourceDecompiler,
type Loader,
type Printer,
} from "jd-core";
const loader: Loader = {
canLoad: (name) => name === "com/example/MyClass",
load: (name) => classFiles.get(name) ?? null,
};
const printer: Printer = new SourcePrinter();
new ClassFileToJavaSourceDecompiler().decompile(
loader,
printer,
"com/example/MyClass", // JVM internal name; omit ".class"
);An optional Map<string, unknown> may be passed as the fourth argument to reuse configuration and caches.
LICENSE
GNU GPL v3
