2024-10-01 03:54:36 +02:00
|
|
|
import { tapBpm } from './tap-bpm.js';
|
2024-09-28 01:30:49 +02:00
|
|
|
|
2024-10-01 03:54:36 +02:00
|
|
|
function main() {
|
2024-09-28 01:30:49 +02:00
|
|
|
// subcommand for tap-bpm
|
2024-10-01 03:54:36 +02:00
|
|
|
if (process.argv[2] === 'tap-bpm') {
|
|
|
|
tapBpm();
|
2024-09-28 01:30:49 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-10-01 03:54:36 +02:00
|
|
|
main();
|
2024-09-28 01:30:49 +02:00
|
|
|
|
|
|
|
// sleep in a loop to block nodejs
|
2024-10-01 03:54:36 +02:00
|
|
|
console.log('Blocking event loop...');
|
2024-09-28 01:30:49 +02:00
|
|
|
while (true) {
|
2024-10-01 03:54:36 +02:00
|
|
|
await new Promise(resolve => setTimeout(resolve, 1000));
|
2024-09-28 01:30:49 +02:00
|
|
|
}
|