summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/examples/beep/index.js
blob: c1ec929d0bf8a6238390b5e4004ee4a8fb64193f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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())