securityos/node_modules/seq/examples/stat_all.coffee

17 lines
343 B
CoffeeScript
Raw Normal View History

2024-09-06 15:32:35 +00:00
fs = require 'fs'
Hash = require 'hashish'
Seq = require 'seq'
Seq()
.seq_((next) ->
fs.readdir(__dirname, next)
)
.flatten()
.parEach_((next, file) ->
fs.stat(__dirname + '/' + file, next.into(file))
)
.seq_((next) ->
sizes = Hash.map(next.vars, (s) -> s.size)
console.dir sizes
)