How do I handle the file system?
If you want to expose directory contents with stats as a Bacon EventStream or a Property, you can use the combine-family of functions to combine the filename and stats without monkey-patching:

var fs = require("fs")
var Bacon = require("../dist/Bacon.js")

// statsForFile :: String -&gt; Property { filename :: String, stats :: Stats }
function statsForFile(filename) {
  return Bacon.combineTemplate({
    name: filename,
    stats: Bacon.fromNodeCallback( fs.stat, filename )
  })      
}


You can expose directory contents as a stream of filenames:

// directoryContents :: String -&gt; EventStream String
function directoryContents(dir) {
  return Bacon.fromNodeCallback(fs.readdir, dir)
    .flatMap(function(names) { return Bacon.fromArray(names)})
}


Then you can compose these two like

function statsForDir(dir) {
  return directoryContents(dir).flatMap(statsForFile)
}


And see what happens:

statsForDir(".").log()


So that's how you can compose these things asynchronously using Bacon.js and FRP. This is not a prime example of where FRP is really useful yet, but when more composition is involved the benefits will be greater. Hope this helps!