write an object to nested file tree, with one file for each value
npm install write-file-tree
var writeFileTree =
writeFileTree(basedir, tree[, opts], cb)
Recursively write each value in the
tree object to a directory
opts can be an object:
opts.encoding- encoding to pass to
opts.limit- max amount of i/o operations to run simultaneously. default 5.
cb is a node-style callback receiving an
error in the first parameter.
Object keys in the
tree object are file names, while values are the file contents. Nested directories have another
tree object as their value.
For example, the test/fixture directory can be written by using this object:
writeFileTree.sync(basedir, tree[, opts])
The same, but sync.