{"_id":"file-tree","_rev":"1656897","name":"file-tree","description":"Generate a tree of file metadata that matches d3's hierarchy layout format","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"}],"time":{"modified":"2026-11-01T04:38:59.000Z","created":"2013-08-10T00:15:57.811Z","1.0.0":"2015-02-06T02:58:58.388Z","0.0.0":"2013-08-10T00:15:57.811Z"},"users":{"fgribreau":true},"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"http://hughskennedy.com/"},"repository":{"type":"git","url":"git://github.com/hughsk/file-tree.git"},"versions":{"1.0.0":{"name":"file-tree","version":"1.0.0","description":"Generate a tree of file metadata that matches d3's hierarchy layout format","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/hughsk/file-tree.git"},"keywords":["hierarchy","children","tree","file","metadata","d3"],"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"http://hughskennedy.com/"},"license":"MIT","dependencies":{"async-reduce":"0.0.1","commondir":"0.0.1","flat":"~1.0.0"},"gitHead":"c06a6246a50536a69c90085dbceabe19c337a516","bugs":{"url":"https://github.com/hughsk/file-tree/issues"},"homepage":"https://github.com/hughsk/file-tree","_id":"file-tree@1.0.0","_shasum":"fdad999cb7fa44438350b514c78f935b306e93e3","_from":".","_npmVersion":"2.4.1","_nodeVersion":"0.10.36","_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"}],"dist":{"shasum":"fdad999cb7fa44438350b514c78f935b306e93e3","tarball":"http://registry-npm.ywwl.com/file-tree/download/file-tree-1.0.0.tgz","integrity":"sha512-f+1ZTaOna4XXO5l0afq1z1fnPJliEY/7HSkbIKAOLcYnlnHRFaVC0JMbNGh9Loai5yRMsK4oyoSer+8/6XZVNg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDTOIVnBpO7rVhrzmaU3xXoQBQzu3mGYTaaKUE6VIAHLwIhAOlNq70ffX203szb63A1A7jx2h1EN/HyZAcx1zsvoxg2"}],"size":2030,"noattachment":false,"key":"/file-tree/-/file-tree-1.0.0.tgz"},"publish_time":1423191538388,"_cnpm_publish_time":1423191538388},"0.0.0":{"name":"file-tree","version":"0.0.0","description":"Generate a tree of file metadata that matches d3's hierarchy layout format","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/hughsk/file-tree.git"},"keywords":["hierarchy","children","tree","file","metadata","d3"],"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"http://hughskennedy.com/"},"license":"MIT","dependencies":{"async-reduce":"0.0.1","commondir":"0.0.1","flat":"~1.0.0"},"_id":"file-tree@0.0.0","dist":{"shasum":"d43494d02fffd36b0720d85e974044dfd0a21d24","tarball":"http://registry-npm.ywwl.com/file-tree/download/file-tree-0.0.0.tgz","integrity":"sha512-qIXmiwz/zYwCkxf2ag4hl78s2xxImhTGU0LMThfRVh964zLsUKlqSNw98RlQuu/eg2bqOSGNstix02Jsgs4JIQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB31c8qDJh77k7gwq2QEG4G84vy9HpNsI3xzYXmDvP/HAiEAiv7Fmp5SD3DkAt4VQzkyoGE0L6YyWjpP4CKTkNmzh24="}],"size":2032,"noattachment":false,"key":"/file-tree/-/file-tree-0.0.0.tgz"},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"}],"publish_time":1376093757811,"_cnpm_publish_time":1376093757811}},"readme":"# file-tree #\n\nA more flexible, asynchronous version of\n[file-size-tree](http://github.com/hughsk/file-size-tree).\n\n## Installation ##\n\n``` bash\nnpm install file-tree\n```\n\n## Usage ##\n\n### `require('file-tree')(files, mapper, callback)` ###\n\nTakes an array of `files`.\n\n`mapper(filename, next)` should pass an object to the the callback\nwith the metadata you want to associate with the file.\n\n`callback(err, tree)` is called when everything's done.\n\n``` javascript\nvar tree = require('file-tree')\nvar fs = require('fs')\n\ntree([\n    __dirname + '/project/src/index.js'\n  , __dirname + '/project/src/README.md'\n  , __dirname + '/project/src/package.json'\n  , __dirname + '/LICENSE'\n], function(filename, next) {\n  fs.stat(filename, function(err, stats) {\n    if (err) return next(err)\n    next(null, {\n      size: stats.size\n    })\n  })\n}, function(err, fileTree) {\n  console.log(fileTree) // done!\n})\n```\n","_attachments":{},"homepage":"https://github.com/hughsk/file-tree","bugs":{"url":"https://github.com/hughsk/file-tree/issues"},"license":"MIT"}