{"id":48211,"library":"java-asm","title":"ASM TypeScript","description":"A TypeScript migration of the Java ASM bytecode manipulation framework, targeting v0.0.6 as the latest release (no regular cadence). This library reads Java class files and exposes parsed structures like annotations, methods, and fields. It is unstable and incomplete: only read operations are supported, write functions are explicitly broken. Compared to the original Java ASM, this port is limited and experimental, maintained by a single developer with no guarantees. Best suited for small-scale annotation reading tasks.","status":"deprecated","version":"0.0.6","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install java-asm","lang":"bash","label":"npm"},{"cmd":"yarn add java-asm","lang":"bash","label":"yarn"},{"cmd":"pnpm add java-asm","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only; no CommonJS support.","wrong":"const ClassReader = require('java-asm')","symbol":"ClassReader","correct":"import { ClassReader } from 'java-asm'"},{"note":"ESM-only; requires named import.","wrong":"const ClassVisitor = require('java-asm').ClassVisitor","symbol":"ClassVisitor","correct":"import { ClassVisitor } from 'java-asm'"},{"note":"Direct named import is correct; the wrong pattern is unnecessarily verbose but works.","wrong":"import * as asm from 'java-asm'; const Opcodes = asm.Opcodes;","symbol":"Opcodes","correct":"import { Opcodes } from 'java-asm'"}],"quickstart":{"code":"import { ClassReader } from 'java-asm';\n\nconst classBytes = new ArrayBuffer(8); // placeholder\nconst reader = new ClassReader(classBytes);\nconst classFile = reader.read();\nconsole.log(classFile.className, classFile.superClass);\nfor (const method of classFile.methods) {\n  console.log('Method:', method.name, method.desc);\n}","lang":"typescript","description":"Reads a Java class file (as ArrayBuffer) and prints class name, super class, and method signatures."},"warnings":[{"fix":"Use a different library like javy-jvm for writing class files.","message":"Write functions are broken and unmaintained.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Ensure input is .class file bytes; for JAR, extract entries first.","message":"Only works with Java class files (not JAR, not live JVM).","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Test thoroughly with your class files; prefer production-ready solutions.","message":"The library is unstable and may produce incorrect results for complex class files.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'annot':33,78 'asm':1,9,57 'best':72 'broken':51 'bytecod':10 'cadenc':21 'class':26 'compar':52 'develop':68 'experiment':63 'explicit':50 'expos':29 'field':36 'file':27 'framework':12 'function':48 'guarante':71 'incomplet':41 'java':8,25,56 'javascript':81 'latest':17 'librari':23 'like':32 'limit':61 'maintain':64 'manipul':11 'method':34 'migrat':5 'oper':44 'origin':55 'pars':30 'port':59 'read':24,43,79 'regular':20 'releas':18 'scale':77 'singl':67 'small':76 'small-scal':75 'structur':31 'suit':73 'support':46 'target':13 'task':80 'typescript':2,4 'unstabl':39 'v0.0.6':14 'write':47","created_at":"2026-06-07T16:55:28.068436+00:00","updated_at":"2026-06-07T16:55:28.068436+00:00","problems":[{"fix":"Use import { ClassReader } from 'java-asm' in an ESM context.","cause":"Using CommonJS require instead of ESM import.","error":"TypeError: ClassReader is not a constructor"},{"fix":"Run npm install java-asm --save (but note it's deprecated).","cause":"Package is not installed or not in node_modules.","error":"Cannot find module 'java-asm'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"java-asm","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}