whisper-node
whisper-node copied to clipboard
Is there a way to use this with a regular .js file rather than this 'import' typescript style
I'm on nodejs 20. I don't want to use typescript, but I do want to use whisper-node in javascript
the import statement of import whisper from 'whisper-node';
returns Cannot use import statement outside of a module when I add it to my .js file.
is there a way to just simply declare this dependency at the top with a simple require statement like I do for all my other modules, that way I'm not declaring every function.
What do you suggest, I'd love to start using this
I'd love to be able to just simple add the dependency statement at the top and do my thing, create functions and call the functions of the dependency. Is that possible?
I'm looking to do something like this
const whisper = require('whisper-node');
(async () => {
try {
const transcription = await whisper.whisper("./audio/output.wav");
console.log(transcription);
process.exit(0);
} catch (err) {
console.log("ERROR", err);
process.exit(1);
}
})();