securityos/node_modules/seq/examples/parseq.coffee

13 lines
390 B
CoffeeScript
Raw Normal View History

2024-09-06 15:32:35 +00:00
fs = require 'fs'
exec = require('child_process').exec
Seq = require 'seq'
Seq()
.seq_((next) -> exec 'whoami', next)
.par_((next, who) -> exec('groups ' + who, next))
.par_((next, who) -> fs.readFile(__filename, 'utf8', next))
.seq_((next, groups, src) ->
console.log('Groups: ' + groups.trim())
console.log('This file has ' + src.length + ' bytes')
)