RosettaCodeData/Task/Execute-a-system-command/CoffeeScript/execute-a-system-command.coffee

10 lines
248 B
CoffeeScript
Raw Permalink Normal View History

2013-10-27 22:24:23 +00:00
{ spawn } = require 'child_process'
ls = spawn 'ls'
ls.stdout.on 'data', ( data ) -> console.log "Output: #{ data }"
ls.stderr.on 'data', ( data ) -> console.error "Error: #{ data }"
ls.on 'close', -> console.log "'ls' has finished executing."