优化后端

This commit is contained in:
Miayui
2026-09-11 17:56:56 +08:00
parent 7eed11b774
commit 812e67422d
7299 changed files with 1744959 additions and 112 deletions
@@ -0,0 +1,20 @@
#!/usr/bin/env node
'use strict';
const path = require('path');
const { createWorker } = require('../..');
const [,, imagePath] = process.argv;
const image = path.resolve(__dirname, (imagePath || '../../tests/assets/images/cosmic.png'));
console.log(`Recognizing ${image}`);
(async () => {
const worker = await createWorker('eng', 1, {
logger: (m) => console.log(m),
});
const { data: { text } } = await worker.recognize(image);
console.log(text);
await worker.terminate();
})();