unrpyc-pure
v1.1.0
Published
Pure JS Ren'Py .rpyc decompiler with npm CLI and JS API
Downloads
298
Maintainers
Readme
UnrpycPure
UnrpycPure is a pure JavaScript Ren'Py toolkit for .rpyc decompilation, translation generation, and .rpa archive handling.
Unlike some similar tools, this package does not run the Python version in the browser.
If you want to preview RPA online, go RPA-Explorer.
Features
- Decompile a single
.rpycfile or an entire directory - Generate translation templates in Ren'Py
.rpyformat or JSON - Unpack a single
.rpaarchive into a directory in Node.js - Open an
.rpaarchive in the browser as a lazy index and read entries on demand
Install
npm install unrpyc-pureCLI Usage
Decompile one file or a directory of .rpyc files:
npx unrpyc <input> [output]
npx unrpyc example.rpyc # writes example.rpy next to input
npx unrpyc example.rpyc example.rpy # single file
npx unrpyc /path/in/ # writes /path/in-decompiled/
npx unrpyc /path/in/ /path/out/ # writes /path/out/in/Generate Ren'Py translation templates:
npx unrpyc --gen-translate text <language> <input> [output]
npx unrpyc --gen-translate text chinese example.rpyc # writes chinese/example.rpy next to input
npx unrpyc --gen-translate text chinese example.rpyc example.rpy # single file
npx unrpyc --gen-translate text chinese /path/in/ # writes /path/in/chinese/
npx unrpyc --gen-translate text chinese /path/in/ /path/out/ # writes /path/out/chinese/Generate translation JSON:
npx unrpyc --gen-translate json <input> [output]
npx unrpyc --gen-translate json example.rpyc # writes translate-json/example.json next to input
npx unrpyc --gen-translate json /path/in/ # writes /path/in/translate-json/
npx unrpyc --gen-translate json /path/in/ /path/out/ # writes /path/out/translate-json/Unpack a single RPA archive:
npx unrpyc --unpack-rpa archive.rpa out # unpack archive to out/archive/Node.js Usage
import {
decompileRpyc,
genTranslate,
unpackRpa,
openRpa
} from 'unrpyc-pure';
await decompileRpyc('/path/in/', '/path/out/');
await genTranslate('/path/in/', '/path/out/', 'text', { language: 'chinese' });
await genTranslate('/path/in/', '/path/out/', 'json');
await unpackRpa('archive.rpa', '/path/out/');
const archive = await openRpa(rpaBuffer);
const script = await archive.decompile('game/script.rpyc');Browser
import { openRpa } from 'unrpyc-pure';
const archive = await openRpa(rpaFile);
const entry = archive.files.get('game/script.rpyc');
const bytes = await archive.read(entry);
const script = await archive.decompile('game/script.rpyc');
const optionsText = await archive.readText('game/options.rpy');Documentation
Full API documentation is in docs/API.md.
Special thanks
Special thanks to the original Python unrpyc project.
This JavaScript version borrows heavily from the ideas, structure, and behavior of the Python implementation.
