feat: first step
This commit is contained in:
21
examples/playground.ts
Normal file
21
examples/playground.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import fs from 'node:fs/promises';
|
||||
import {
|
||||
ReadableStream,
|
||||
WritableStream,
|
||||
type TransformStream,
|
||||
} from 'node:stream/web';
|
||||
import { EbmlStreamDecoder } from 'konoebml';
|
||||
|
||||
async function main() {
|
||||
const fileBuffer = await fs.readFile('media/test.webm');
|
||||
await new ReadableStream({
|
||||
pull(controller) {
|
||||
controller.enqueue(fileBuffer);
|
||||
controller.close();
|
||||
},
|
||||
})
|
||||
.pipeThrough(new EbmlStreamDecoder() as unknown as TransformStream)
|
||||
.pipeTo(new WritableStream({ write: console.log }));
|
||||
}
|
||||
|
||||
main();
|
||||
Reference in New Issue
Block a user