ts-plug-encrypt
v0.1.0
Published
AES-GCM encryption wrapper using native Linux binary (Bun runtime)
Readme
ts-plug-encrypt
ts-plug-encrypt adalah TypeScript module (Bun runtime) yang berfungsi sebagai wrapper / callback untuk binary plug-encrypt yang ditulis menggunakan Go.
Module ini menyediakan API sederhana berbasis async function untuk melakukan file encryption & decryption (AES-GCM) tanpa perlu berinteraksi langsung dengan CLI.
⚠ Platform saat ini: Linux only
Binary untuk Windows & macOS akan tersedia di versi selanjutnya.
Requirements
- Bun >= 1.0
- Linux
- Binary
plug-encrypt(sudah disertakan di package)
Module ini tidak mendukung Node.js.
Installation
Bun registry
bun add ts-plug-encryptnpm (Bun runtime only)
bun add ts-plug-encryptUsage
Import module
import { TsPlugencrypt } from "ts-plug-encrypt";Encrypt file
await TsPlugencrypt.encrypt(
"examples/input.txt",
"examples/output.encrypt"
);Decrypt file
await TsPlugencrypt.decrypt(
"examples/output.encrypt",
"examples/input.txt"
);API
TsPlugencrypt.encrypt(inputfile, outputfile)
Encrypt file menggunakan AES-GCM.
Parameters
inputfile: stringPath file plaintextoutputfile: stringPath file output terenkripsi
Returns
Promise<void>
TsPlugencrypt.decrypt(targetfile, outputfile)
Decrypt file terenkripsi ke bentuk plaintext.
Parameters
targetfile: stringPath file terenkripsioutputfile: stringPath file hasil dekripsi
Returns
Promise<void>
Platform Support
| Platform | Status | | -------- | ----------- | | Linux | ✅ Supported | | Windows | ⏳ Planned | | macOS | ⏳ Planned |
Notes
- Module ini menggunakan Bun native
spawnAPI - Binary
plug-encryptdipanggil sebagai child process - Error dari binary akan dilempar sebagai
Error - Jangan jalankan module ini di environment non-Linux
License
MIT
