diff options
Diffstat (limited to 'gold/bitcoinwisdom/beep.js')
-rw-r--r-- | gold/bitcoinwisdom/beep.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gold/bitcoinwisdom/beep.js b/gold/bitcoinwisdom/beep.js new file mode 100644 index 00000000..80a0cb0f --- /dev/null +++ b/gold/bitcoinwisdom/beep.js @@ -0,0 +1,30 @@ +module.exports = { + create_beeper: create_beeper, +} + +var child_process = require('child_process'); + +function create_beeper (spec) { + return { + beep: beep, + } + function beep (freq, len) { + var child = child_process.spawn('beep', [ + '-f', freq, + '-l', len, + ]); + child.stdout.on('data', function (data) { + console.log('stdout: ' + data); + }); + + child.stderr.on('data', function (data) { + console.log('stderr: ' + data); + }); + + child.on('close', function (code) { + if (code !== 0) { + console.log('child process exited with code ' + code); + } + }); + } +} |