Update and fix browser example

This commit is contained in:
Jerome Wu
2019-10-25 17:50:37 +08:00
parent 9e5d0c5cc6
commit f162e481c3
6 changed files with 17 additions and 22 deletions

View File

@@ -1,3 +1,4 @@
const fs = require('fs');
const { createWorker } = require('../../src');
const { argv } = process;
@@ -8,5 +9,5 @@ const worker = createWorker();
(async () => {
await worker.load();
const { data } = await worker.transcode(inputPath, outputPath.split('.').pop());
console.log(data.length);
fs.writeFileSync(outputPath, Buffer.from(data));
})();