A proof-of-concept JavaScript obfuscation tool that converts individual functions into bytecode executed by a custom virtual machine (VM) written in JavaScript. Version 1.0.2 is the current and only release. The transpiler converts functions marked with `// @virtualize` into opcodes for the VM. Key differentiators: unlike traditional obfuscators that rename/transform AST, this executes code in an interpreted VM, making reverse engineering significantly harder. Not intended for whole programs due to performance overhead; targets server-side Node.js, not browsers. Development appears stalled (no updates since initial release).
npm install js-virtualizerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates transpiling a simple virtualized function with multiple passes, writing output to files, and handling configuration options.
Ensure all functions that should be virtualized have the exact comment // @virtualize on the line immediately above the function declaration.
Only use // @virtualize on small, critical functions. Test performance impact before production.
Avoid using concurrent async functions inside virtualized code. Use sequential awaits or callbacks.
If using in a browser, replace require() calls in vm_dist.js with browser-compatible imports (e.g., ES modules or window globals).
Edit src/vm_dist.js to rename opcode identifiers and apply obfuscation to the VM itself.
For production obfuscation, consider alternatives like jscrambler, javascript-obfuscator, or commercial solutions. Maintain your own fork if needed.
Add // @virtualize as a comment line immediately before the function declaration you want to virtualize.
Use await or .then() to handle the asynchronous transpile() call.
Refactor the virtualized function to avoid relying on 'this'. Use explicit parameters or bind the context outside.
No dependency data recorded yet.