How I trigger the “System Bell” in nodejs

后端 未结 2 545
野性不改
野性不改 2020-12-15 16:23

I\'m running a long running custom nodejs script and would like to be notified when the script is completed.

How do I make nodejs trigger the \"System Bell\"?

2条回答
  •  一生所求
    2020-12-15 16:54

    The console.log('\u0007') didn't work for me running VSCode on windows 10. The following code did work:

    import { exec } from 'child_process'
    exec(`rundll32 user32.dll,MessageBeep`)
    

提交回复
热议问题