Created
July 21, 2012 05:01
-
-
Save taterbase/3154646 to your computer and use it in GitHub Desktop.
System Beep in Node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function alertTerminal(){ | |
console.log("\007"); | |
} |
@mayeaux Mine didn't work because I was running the code in VSCode terminal, after switching to main terminal it worked
windows or wsl
require("child_process").exec("powershell.exe [console]::beep(500,600)");
Mac
require("child_process").exec("afplay /System/Library/Sounds/Glass.aiff");
Yeah, for some reason in VScode terminal it doesn't sound, in main terminal it works. Thanks for the tip!
windows or wsl
require("child_process").exec("powershell.exe [console]::beep(500,600)");
Mac
require("child_process").exec("afplay /System/Library/Sounds/Glass.aiff");
Thank you very much!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
in git bash terminal
echo -e "\a"