aboutsummaryrefslogtreecommitdiff
path: root/cordova/node_modules/ansi/examples/beep/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'cordova/node_modules/ansi/examples/beep/index.js')
-rwxr-xr-xcordova/node_modules/ansi/examples/beep/index.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/cordova/node_modules/ansi/examples/beep/index.js b/cordova/node_modules/ansi/examples/beep/index.js
new file mode 100755
index 0000000..c1ec929
--- /dev/null
+++ b/cordova/node_modules/ansi/examples/beep/index.js
@@ -0,0 +1,16 @@
+#!/usr/bin/env node
+
+/**
+ * Invokes the terminal "beep" sound once per second on every exact second.
+ */
+
+process.title = 'beep'
+
+var cursor = require('../../')(process.stdout)
+
+function beep () {
+ cursor.beep()
+ setTimeout(beep, 1000 - (new Date()).getMilliseconds())
+}
+
+setTimeout(beep, 1000 - (new Date()).getMilliseconds())