{"_id":"file-index","_rev":"21-168af94127b736322ef790fc535557b4","name":"file-index","time":{"modified":"2022-06-18T00:36:20.583Z","created":"2014-09-13T03:36:48.006Z","1.0.0":"2014-09-13T03:36:48.006Z","1.0.1":"2014-09-13T03:40:42.195Z","2.0.1":"2014-10-05T23:57:18.838Z","2.0.2":"2014-10-11T18:59:01.330Z","2.0.3":"2014-10-11T19:13:23.834Z","2.0.4":"2016-05-06T12:51:13.842Z","2.0.5":"2016-05-06T12:52:05.486Z","2.0.6":"2016-05-06T12:58:19.750Z","2.0.7":"2016-05-06T13:02:55.410Z","2.0.8":"2016-05-07T03:07:53.012Z","2.0.9":"2016-05-07T12:25:38.339Z","2.0.10":"2017-11-02T20:48:01.886Z"},"maintainers":[{"name":"yaniv","email":"yanivk@gmail.com"},{"name":"kessler","email":"yanivk@gmail.com"}],"dist-tags":{"latest":"2.0.10"},"description":"load files into a memory index","readme":"# file-index\n\nQuickly create an in memory index of files and (optionally) their content\n\nUses [minimatch](https://github.com/isaacs/minimatch) to filter files included in the index\n\n### simple\n```javascript\nvar FileIndex = require('file-index')\n\nFileIndex.load(['/some/path'], function (err, results) {\n\t// loads and parses json files\n\t// loads all the rest of the files as buffers\n\t// results: { '/some/path/1.json': { a: 1}, '/some/path/2.txt': buffer }\n})\n\nFileIndex.scan(['/some/path'], function(err, files) {\n\t// scan all files in path recursively and returns an index\n\t// { '/some/path/1': stat, '/some/path/2': stat }\n\t// where stat is the result of running fs.stat on each file\n})\n```\n\n### customize\n```javascript\nfunction myCustomHandler(fullPathFilename, callback) {\n\tfs.readFile(fullPathFilename, function (err, content) {\n\t\tif (err) return callback(err)\n\n\t\tcallback(null, customParse(content))\n\t})\t\n}\n\nvar handlers = FileIndex\t\n\t.handle('*.json', FileIndex.loadJsonFile) // load and parse .json files\t\n\t.handle('*.foo', FileIndex.loadRawFile)\t// .foo as buffers\n\t.handle('*.bar', FileIndex.loadRawUtf8File) // .bar as text\n\t.handle('*', myCustomHandler) // a non mandatory fallthrough custom handler\n\t.create()\n\n// mix directories and files\nFileIndex.load(['/some/path/', '/some/file.bar', '/yet/another/path'], handlers, function(err, results) {\n\tconsole.log(err, results)\n\n\t/* \n\t\tresults:\n\t\t\n\t\t{\n\t\t\t'/some/path/1.json': { blabla: 1 },\n\t\t\t'/some/path/2.json': { blabla: 2},\n\t\t\t'/some/file.bar': 'foorbar',\n\t\t\t'/yet/another/path/x.log': 'a b c'\n\t\t}\n\t*/\n})\n```\n\n// TODO: improve test coverage\n","versions":{"1.0.1":{"name":"file-index","version":"1.0.1","description":"load files into a memory index","main":"index.js","scripts":{"test":"mocha -R spec"},"dependencies":{"async":"^0.9.0","lodash.clonedeep":"^2.4.1","minimatch":"^1.0.0"},"author":{"name":"Yaniv Kessler"},"bugs":{"url":"https://github.com/kessler/node-file-index/issues"},"repository":{"type":"git","url":"https://github.com/kessler/node-file-index"},"homepage":"https://github.com/kessler/node-file-index","license":"MIT","_id":"file-index@1.0.1","_shasum":"58cc0cd0294726da923dedf382583c609c4db294","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"yaniv","email":"yanivk@gmail.com"},"maintainers":[{"name":"yaniv","email":"yanivk@gmail.com"}],"dist":{"shasum":"58cc0cd0294726da923dedf382583c609c4db294","tarball":"https://registry.npmjs.org/file-index/-/file-index-1.0.1.tgz","integrity":"sha512-I3lHAwnzpfPpn++h0vodisb3bFww9cCX7gAZdy5nwqEqOKLIrXaulXVHPnVSaGJflBLn+wODOlVUMe30DNU6fw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8hMcNaqgdno4Rk02rOK+9Cc2gUm/N6qmzxlPgUG8SOQIgZKNDg5e0DVskq5jTRgWFTIsIFKe4jmCTjHOPkAdxgws="}]}},"2.0.1":{"name":"file-index","version":"2.0.1","description":"load files into a memory index","main":"index.js","scripts":{"test":"mocha -R spec"},"dependencies":{"async":"^0.9.0","lodash.clonedeep":"^2.4.1","lodash.uniq":"^2.4.1","minimatch":"^1.0.0"},"author":{"name":"Yaniv Kessler"},"bugs":{"url":"https://github.com/kessler/node-file-index/issues"},"repository":{"type":"git","url":"https://github.com/kessler/node-file-index"},"homepage":"https://github.com/kessler/node-file-index","license":"MIT","_id":"file-index@2.0.1","_shasum":"d9bcde497eeb9e5fa00f3c3806de1d89becf9cf2","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"yaniv","email":"yanivk@gmail.com"},"maintainers":[{"name":"yaniv","email":"yanivk@gmail.com"}],"dist":{"shasum":"d9bcde497eeb9e5fa00f3c3806de1d89becf9cf2","tarball":"https://registry.npmjs.org/file-index/-/file-index-2.0.1.tgz","integrity":"sha512-zBgV/3R74nPU02Lq4wO5V3nxREYOHKRcDQPcizF4OVsOqKAr+3tqBKo+H9plLMhXbK8hLVjdLK46HSimzsKHrw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDE0cJkvgOTY4ZPF5gUT2sdJVlfhjXDltVTJeTxdLIdjAiEA/AVporrcrxQwNnlyfGOLGusbFNrkhGMocsogxxjn9x4="}]}},"2.0.2":{"name":"file-index","version":"2.0.2","description":"load files into a memory index","main":"index.js","scripts":{"test":"mocha -R spec"},"dependencies":{"async":"^0.9.0","lodash.clonedeep":"^2.4.1","lodash.uniq":"^2.4.1","minimatch":"^1.0.0"},"author":{"name":"Yaniv Kessler"},"bugs":{"url":"https://github.com/kessler/node-file-index/issues"},"repository":{"type":"git","url":"https://github.com/kessler/node-file-index"},"homepage":"https://github.com/kessler/node-file-index","license":"MIT","_id":"file-index@2.0.2","_shasum":"79ebbda2334fc17a286d2c0081f34c0f1cc8cdc2","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"yaniv","email":"yanivk@gmail.com"},"maintainers":[{"name":"yaniv","email":"yanivk@gmail.com"}],"dist":{"shasum":"79ebbda2334fc17a286d2c0081f34c0f1cc8cdc2","tarball":"https://registry.npmjs.org/file-index/-/file-index-2.0.2.tgz","integrity":"sha512-QrtOTM7tvJSDLw5i5drar1a3p4GjDIVDDt8MkPrOtd845a7YUSbo33vvQ6jdBod5PedvKQ/ibx3ORuZjpstXQA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC7iIsVp3bX9xqVy209gU3Gvlawh1M98kqGfI5/vMBq8AiAPv2YYM9rC3wrRRdsLyIXe9jeEczSN9SoS8u8cjokgoA=="}]}},"2.0.3":{"name":"file-index","version":"2.0.3","description":"load files into a memory index","main":"index.js","scripts":{"test":"mocha -R spec"},"dependencies":{"async":"^0.9.0","lodash.clonedeep":"^2.4.1","lodash.uniq":"^2.4.1","minimatch":"^1.0.0"},"author":{"name":"Yaniv Kessler"},"bugs":{"url":"https://github.com/kessler/node-file-index/issues"},"repository":{"type":"git","url":"https://github.com/kessler/node-file-index"},"homepage":"https://github.com/kessler/node-file-index","license":"MIT","_id":"file-index@2.0.3","_shasum":"160e5c4d338e32344ee9d78f519bfa2c12ed8809","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"yaniv","email":"yanivk@gmail.com"},"maintainers":[{"name":"yaniv","email":"yanivk@gmail.com"}],"dist":{"shasum":"160e5c4d338e32344ee9d78f519bfa2c12ed8809","tarball":"https://registry.npmjs.org/file-index/-/file-index-2.0.3.tgz","integrity":"sha512-GF1OCxLyjVz9EjwvujRJzV6GjBiXM1gG8gp4NMm801OthswHGhkDcOJ7cqukL+04WOIWqBUzozhYCNYccMblmw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGb6gxKmbX4Wf1OC1H3O1JQqVVJxpEdT728TE/6ZMA+vAiBhyjL6tFbjaGOEMooRTonsZgXODWanA72VbUV7RBbRJA=="}]}},"2.0.4":{"name":"file-index","version":"2.0.4","description":"load files into a memory index","main":"index.js","scripts":{"test":"mocha -R spec"},"dependencies":{"async":"^0.9.0","lodash.clonedeep":"^2.4.1","lodash.uniq":"^2.4.1","minimatch":"^1.0.0"},"author":{"name":"Yaniv Kessler"},"bugs":{"url":"https://github.com/kessler/node-file-index/issues"},"repository":{"type":"git","url":"https://github.com/kessler/node-file-index"},"homepage":"https://github.com/kessler/node-file-index","license":"MIT","gitHead":"d05e70f5731d0c4c87ae7e12d43c82efcba3675f","_id":"file-index@2.0.4","_shasum":"f01ba60f87a17463ce353ec37a48de4f497dd4a4","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.5.0","_npmUser":{"name":"kessler","email":"yanivk@gmail.com"},"dist":{"shasum":"f01ba60f87a17463ce353ec37a48de4f497dd4a4","tarball":"https://registry.npmjs.org/file-index/-/file-index-2.0.4.tgz","integrity":"sha512-kN3gZjTu5lDlSzsEQ8n4x/8+IBQK9M/Ic9txZrlnZhGrINyS824B2q/IAkZcM5N+/qrus7yy2E5xU1K5AjZZNg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkNv8gD/jbo3jrDFjQT8v0Jpzc9jdbF1xXrJJ2Eh4D0QIhAJA5iIpS5TVbbKY4bHZJQ8w+2cCr4c/UlDhTEK9PqL62"}]},"maintainers":[{"name":"yaniv","email":"yanivk@gmail.com"},{"name":"kessler","email":"yanivk@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/file-index-2.0.4.tgz_1462539071254_0.9529687822796404"}},"2.0.5":{"name":"file-index","version":"2.0.5","description":"load files into a memory index","main":"index.js","scripts":{"test":"mocha -R spec"},"dependencies":{"async":"^0.9.0","lodash.clonedeep":"^2.4.1","lodash.uniq":"^2.4.1","minimatch":"^1.0.0"},"author":{"name":"Yaniv Kessler"},"bugs":{"url":"https://github.com/kessler/node-file-index/issues"},"repository":{"type":"git","url":"https://github.com/kessler/node-file-index"},"homepage":"https://github.com/kessler/node-file-index","license":"MIT","gitHead":"5a4d09904bdc6e30b2aaa643d248ecb1de8319ea","_id":"file-index@2.0.5","_shasum":"ee2001ab2f6aee59ce2e109d4e3a72d6df3def54","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.5.0","_npmUser":{"name":"kessler","email":"yanivk@gmail.com"},"dist":{"shasum":"ee2001ab2f6aee59ce2e109d4e3a72d6df3def54","tarball":"https://registry.npmjs.org/file-index/-/file-index-2.0.5.tgz","integrity":"sha512-A2/seeAM7bQVWLj26fPV6VAMw5DGN2y/K0vM6g6wOFNb00jeEUHelePOmz0BJzSniVyQnYqRZGrdG3949+66zQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHCmSrBhKsKYAN1KahTe5CIDOkZxuapEGD5wGYQTTiRVAiEA7ieDSX31veM7JkF0/fEe1hUSEoBooVEmSy1u4fCdfKw="}]},"maintainers":[{"name":"yaniv","email":"yanivk@gmail.com"},{"name":"kessler","email":"yanivk@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/file-index-2.0.5.tgz_1462539123007_0.9639129501301795"}},"2.0.6":{"name":"file-index","version":"2.0.6","description":"load files into a memory index","main":"index.js","scripts":{"test":"mocha -R spec"},"dependencies":{"async":"^0.9.0","lodash.clonedeep":"^2.4.1","lodash.uniq":"^2.4.1","minimatch":"^1.0.0"},"author":{"name":"Yaniv Kessler"},"bugs":{"url":"https://github.com/kessler/node-file-index/issues"},"repository":{"type":"git","url":"https://github.com/kessler/node-file-index"},"homepage":"https://github.com/kessler/node-file-index","license":"MIT","gitHead":"3cb7054bedabf6061fc99dc32f9ad899bad085af","_id":"file-index@2.0.6","_shasum":"f235401dff3700f93e37888e9e4311d177df4434","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.5.0","_npmUser":{"name":"kessler","email":"yanivk@gmail.com"},"dist":{"shasum":"f235401dff3700f93e37888e9e4311d177df4434","tarball":"https://registry.npmjs.org/file-index/-/file-index-2.0.6.tgz","integrity":"sha512-o7xanPke12UrsFiuNiignbqGxy3Km8HKPpM/PIMmIFritQ1/s9D5UmC8IcdSUh6TJW+5XMPYfpkEm5lUfEva8w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAaOB8IU2uB0TxKy0m7n9VCMuNhW3H8NtKvtp3yOezTmAiEA9H7is2fCSGcfvd8Hqxb7d4724qwBUhpUQCjwgHrKeUo="}]},"maintainers":[{"name":"yaniv","email":"yanivk@gmail.com"},{"name":"kessler","email":"yanivk@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/file-index-2.0.6.tgz_1462539498135_0.7738853744231164"}},"2.0.7":{"name":"file-index","version":"2.0.7","description":"load files into a memory index","main":"index.js","scripts":{"test":"mocha -R spec"},"dependencies":{"async":"^0.9.0","lodash.clonedeep":"^2.4.1","lodash.uniq":"^2.4.1","minimatch":"^1.0.0"},"author":{"name":"Yaniv Kessler"},"bugs":{"url":"https://github.com/kessler/node-file-index/issues"},"repository":{"type":"git","url":"https://github.com/kessler/node-file-index"},"homepage":"https://github.com/kessler/node-file-index","license":"MIT","gitHead":"1a38c671d6ce51b6c8a637fe6c3c33ac842ef85d","_id":"file-index@2.0.7","_shasum":"e1b091f35b394efc23211caf90107e49e35a946a","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.5.0","_npmUser":{"name":"kessler","email":"yanivk@gmail.com"},"dist":{"shasum":"e1b091f35b394efc23211caf90107e49e35a946a","tarball":"https://registry.npmjs.org/file-index/-/file-index-2.0.7.tgz","integrity":"sha512-t3+fTCMQN90euS9TxPSpYKpl7cnkqI/9oemRdQVCaOGDn+Oz6Nwp+giKorUqzho4pg4pAk03hgVGdAsUCH2iSA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBXVveWP27nT8XkT0duVYK/5fDcjaoSk7avixYlwSKAwIhAMR6r7P618eefG1AlsHBqSgV3bZWH6BB/5td7c0yLhRC"}]},"maintainers":[{"name":"yaniv","email":"yanivk@gmail.com"},{"name":"kessler","email":"yanivk@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/file-index-2.0.7.tgz_1462539773844_0.9660576810128987"}},"2.0.8":{"name":"file-index","version":"2.0.8","description":"load files into a memory index","main":"index.js","scripts":{"test":"mocha -R spec"},"dependencies":{"async":"^0.9.0","debug":"^2.2.0","lodash.clonedeep":"^2.4.1","lodash.uniq":"^2.4.1","minimatch":"^1.0.0"},"author":{"name":"Yaniv Kessler"},"bugs":{"url":"https://github.com/kessler/node-file-index/issues"},"repository":{"type":"git","url":"https://github.com/kessler/node-file-index"},"homepage":"https://github.com/kessler/node-file-index","license":"MIT","devDependencies":{"mkdirp":"^0.5.1","rimraf":"^2.5.2"},"gitHead":"3056ade019473ded98d297be9cd69760a39a74fa","_id":"file-index@2.0.8","_shasum":"5c23bc292164750667c56854e081b1f49d620f73","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.5.0","_npmUser":{"name":"kessler","email":"yanivk@gmail.com"},"dist":{"shasum":"5c23bc292164750667c56854e081b1f49d620f73","tarball":"https://registry.npmjs.org/file-index/-/file-index-2.0.8.tgz","integrity":"sha512-JK06sJTy/P3PcHpggouRRvnfJbv5KCkOf7W+BXL5bZeyNyPFNJ6WzHQ9YAn2hQw3Aa8aTSYLBvGS/IRAeT11/w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDdB/HT7W4+4SWbrpxj1Hd2oNReHTU5oYBGC0YfHuW5+wIgaRPwSN39IPpRiSdeemdTMKhx3rvC9bgT5SGGzb7HZ1M="}]},"maintainers":[{"name":"yaniv","email":"yanivk@gmail.com"},{"name":"kessler","email":"yanivk@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/file-index-2.0.8.tgz_1462590470562_0.7600155046675354"}},"2.0.9":{"name":"file-index","version":"2.0.9","description":"load files into a memory index","main":"index.js","scripts":{"test":"mocha -R spec"},"dependencies":{"async":"^0.9.0","debug":"^2.2.0","lodash.clonedeep":"^2.4.1","lodash.uniq":"^2.4.1","minimatch":"^1.0.0"},"author":{"name":"Yaniv Kessler"},"bugs":{"url":"https://github.com/kessler/node-file-index/issues"},"repository":{"type":"git","url":"https://github.com/kessler/node-file-index"},"homepage":"https://github.com/kessler/node-file-index","license":"MIT","devDependencies":{"mkdirp":"^0.5.1","rimraf":"^2.5.2"},"gitHead":"7ed82d4a5ed16b75ad6025fd4dac557116a36fc1","_id":"file-index@2.0.9","_shasum":"bcaafd84be5efcf6266d51f4dc6f435f6d387585","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.5.0","_npmUser":{"name":"kessler","email":"yanivk@gmail.com"},"dist":{"shasum":"bcaafd84be5efcf6266d51f4dc6f435f6d387585","tarball":"https://registry.npmjs.org/file-index/-/file-index-2.0.9.tgz","integrity":"sha512-QKYfiZbpo/zNpEwK8eccYi0qHOxPdgXv0PJRdNSn7BeyObGgiadD9D9+gX+h96bdjPlPEDdv+ryn5vjrALDXfw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHvWAEXOzAktSUZnBEJLiXMkQKunjTABX39nEWf2JaA7AiAlz9YJa02a7G34wOsQQuu+Js4BoSwe6+SUk8UZKL3VEA=="}]},"maintainers":[{"name":"yaniv","email":"yanivk@gmail.com"},{"name":"kessler","email":"yanivk@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/file-index-2.0.9.tgz_1462623937290_0.37912409543059766"}},"2.0.10":{"name":"file-index","version":"2.0.10","description":"load files into a memory index","main":"index.js","scripts":{"test":"mocha -R spec"},"dependencies":{"async":"^0.9.0","debug":"^2.2.0","lodash.clonedeep":"^2.4.1","lodash.uniq":"^2.4.1","minimatch":"^3.0.4"},"author":{"name":"Yaniv Kessler"},"bugs":{"url":"https://github.com/kessler/node-file-index/issues"},"repository":{"type":"git","url":"git+https://github.com/kessler/node-file-index.git"},"homepage":"https://github.com/kessler/node-file-index","license":"MIT","devDependencies":{"mkdirp":"^0.5.1","rimraf":"^2.5.2"},"gitHead":"f71a8e2b95f89b438b44cc2e0cf8416cebe87800","_id":"file-index@2.0.10","_shasum":"0c8671984f35bfa140c20270442faaa0f5b40253","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.10.0","_npmUser":{"name":"kessler","email":"yanivk@gmail.com"},"dist":{"shasum":"0c8671984f35bfa140c20270442faaa0f5b40253","tarball":"https://registry.npmjs.org/file-index/-/file-index-2.0.10.tgz","integrity":"sha512-Us7bFIVtvNw8O1dj6UED23W/0dkwNjT27igvt0gjvCE9G7BvUU7wpI0lPsFUoiF51Z6gObozRzxzFEQp5t8L4A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICW4b/I1bXanZxlRzCWpTvc2qjrOel/sPgo++cIS8QmnAiEAug6MJfScST4RKw7aJdz3fvgZMsvOzJbwC97miyPZCfQ="}]},"maintainers":[{"name":"yaniv","email":"yanivk@gmail.com"},{"name":"kessler","email":"yanivk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/file-index-2.0.10.tgz_1509655680914_0.22057524789124727"}}},"homepage":"https://github.com/kessler/node-file-index","repository":{"type":"git","url":"git+https://github.com/kessler/node-file-index.git"},"author":{"name":"Yaniv Kessler"},"bugs":{"url":"https://github.com/kessler/node-file-index/issues"},"license":"MIT","readmeFilename":"README.md"}