diff --git a/src/commands/get.ts b/src/commands/get.ts index 25b2cae..317d27e 100644 --- a/src/commands/get.ts +++ b/src/commands/get.ts @@ -68,10 +68,20 @@ export const get = async (moduleName: string, privacyPass?: string) => { const jsonEncodingStream = new Transform({ writableObjectMode: true, + construct(callback) { + this.push("["); + callback(); + }, transform(chunk, encoding, callback) { + this.emit("append_item"); this.push(JSON.stringify(chunk)); + this.once("append_item", () => { this.push(",") }); callback(); }, + flush(callback) { + this.push("]"); + callback(); + } }); try {