Jvm.js
A Java VM bytecode library written in ES6 for Node.js
Install / Use
/learn @kylestev/Jvm.jsREADME
jvm.js
A bytecode library for Java written in Node.js
This module is under active development and has not yet reached a stable release. This module will be following SemVer once it is ready for use by 3rd parties.
Installation
$ npm install jvm
And you will be able to get started with using jvm.js. Take a look at the next section for some examples of how to get started.
Examples
jvm.js makes use of Promises instead of passing callbacks in functions. This allows your code to not fall victim to the node callback tree of doom. You'll see examples of it in the examples below.
If you're unfamiliar with Promises, or need a refresher, checkout Mozilla's excellent documentation here.
Loading a Jar's classes
The example below uses ES6 and shows how easy it is to parse a Jar file.
import { Jar } from 'jvm';
Jar.unpack('./test.jar')
.then((jar) => {
for (let [name, cls] of jar) {
if (cls.name === 'client') {
console.log('found client class!');
console.log(JSON.stringify({
name: cls.name,
superName: cls.superName,
methodCount: cls.methods.length,
fieldCount: cls.fields.length
}, null, 2));
}
}
})
.catch(console.error.bind(console));
Related Skills
node-connect
347.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
