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

@jar-analyzer/jsd

v1.2.0

Published

Pure TypeScript Java class decompiler - single-file library, no wasm, no native deps

Readme

jsd

Quality Unit Round-trip Modern Java Bytecode Package Fuzz

English | 简体中文

TypeScript 实现的 Java .class 反编译库,支持 Node.js 和浏览器。

你为什么需要该项目:

  • 直接在浏览器中反编译。
  • 文件本地处理,无需后端或上传。
  • 轻松集成到 JavaScript 工具。

单个 JS 文件约 277 KB,gzip 后约 85 KB。 无运行时依赖,无需 WebAssembly 或 Java 环境。

支持常见控制流、lambda、嵌套类、record 及 Java 25 的部分语法。将作为下一代 jar-analyzer 的反编译引擎。

在线体验

使用

npm 包:@jar-analyzer/jsd,已发布版本 1.2.0。

1. 浏览器

通过 CDN 加载并反编译所选 .class 文件。

<input type="file" accept=".class" />
<pre id="source"></pre>
<script type="module">
  import { decompileClassFile } from 'https://cdn.jsdelivr.net/npm/@jar-analyzer/[email protected]/dist/jsd.min.js';

  document.querySelector('input').onchange = async (event) => {
    const file = event.target.files[0];
    if (!file) return;
    const bytes = new Uint8Array(await file.arrayBuffer());
    document.getElementById('source').textContent = decompileClassFile(bytes).source;
  };
</script>

2. Node.js

npm install @jar-analyzer/jsd

保存为 example.mjs,运行 node example.mjs:

import { readFileSync } from 'node:fs';
import { decompileClassFile } from '@jar-analyzer/jsd';

const result = decompileClassFile(readFileSync('Example.class'));
console.log(result.source);

测试

| 测试 | 用例数 | CI 环境 | | ----------------- | -----: | ------------------- | | 格式 | — | Node.js 24 | | 类型 | — | Node.js 24 | | 产物与体积 | — | Node.js 24 | | 浏览器布局 | 4 | Chrome/Chromium | | 单元测试 | 323 | Node.js 24 | | Java 往返:带调试 | 172 | JDK 8/11/17/21/25 | | Java 往返:无调试 | 172 | JDK 8/17/25 | | Java 9–25:带调试 | ≤18 | JDK 21/25 | | Java 9–25:无调试 | ≤18 | JDK 21/25 | | 动态字节码 | ≤37 | JDK 11/17/21/25 | | 值语义 | 9 | JDK 11/17/21/25 | | 畸形 class | 17 | JDK 11/17/21/25 | | 安装包 | — | Node.js 20/24 | | 模糊测试 | 2,000 | Node.js 24 + JDK 25 |

旧版用例同时验证反编译源码按原目标版本及当前 JDK 目标版本重编译后的行为。

JDK 8 验证 Java 6/7 目标;较新 JDK 必要时使用其支持的最低目标版本。

许可证

MIT