| Crates.io | synchrony-rs |
| lib.rs | synchrony-rs |
| version | 0.2.4 |
| created_at | 2025-12-27 07:13:29.415789+00 |
| updated_at | 2026-01-07 12:30:10.252599+00 |
| description | A fast JavaScript deobfuscator written in Rust |
| homepage | |
| repository | https://github.com/waki285/synchrony-rs |
| max_upload_size | |
| id | 2006792 |
| size | 645,241 |

This project is a Rust port of relative/synchrony with additional enhancements for performance and analysis robustness. It targets obfuscation outputs primarily from javascript-obfuscator / obfuscator.io.
# Install
cargo install synchrony-rs
# cargo install synchrony-rs --locked # (alternative)
# Build from source
cargo build --release
# Run
synchrony ./input.js
# ./target/release/synchrony ./input.js
# Output defaults to ./input.cleaned.js
use synchrony_rs::Deobfuscator;
let deob = Deobfuscator::new();
let output = deob.deobfuscate_source("var a = 1;", None).unwrap();
println!("{output}");
Build the wasm package (no CLI, wasm-only bindings). On stable Rust, avoid
--out-dir and copy the generated pkg/ instead:
# Browser (web target)
wasm-pack build --target web --no-default-features --features wasm
cp -R pkg examples/wasm-web/
# Cloudflare Workers (bundler target)
wasm-pack build --target bundler --no-default-features --features wasm
cp -R pkg examples/wasm-workers/
Note: do not mix web/bundler outputs. The web target is for browsers, the bundler target is for Workers (and other bundlers).
JS example (browser or Workers):
import init, { deobfuscate } from "./pkg/synchrony_rs.js";
await init();
const output = deobfuscate("var a = 1 + 2 + 3;", {
rename: false,
sourceType: "script",
ecmaVersion: "es2020",
});
console.log(output);
See the ready-to-run examples:
examples/wasm-webexamples/wasm-workersA static web UI lives in public/ and is meant to be deployed with Cloudflare Pages.
Build command (from repo root):
./scripts/build-pages.sh
Pages settings:
cargo install wasm-pack --locked && ./scripts/build-pages.shpublicNotes:
pkg/ into public/pkg/.--target web for the browser UI. Do not use the bundler output here.If a transformer fails, you will see a message like:
Error: Transformer error: ...
Please share the full terminal output and the input file (plus a minimal reproduction if possible). Avoid screenshots or partial logs.
Tip: build with the tracing feature (enabled by default) and set
RUST_LOG=debug to get more detail about which transformer ran last.