{"_id":"eachkv","_rev":"26-0a87c46a1f73f043d08e22e2a4997d1d","name":"eachkv","description":"key and value iteration for javascript arrays","dist-tags":{"latest":"1.0.11"},"versions":{"1.0.0":{"name":"eachkv","description":"key and value iteration for javascript arrays","author":{"name":"Jonathan Annett","email":"sophtwhere@icloud.com","url":"https://github.com/sophtwhere"},"repository":{"type":"git","url":"https://github.com/sophtwhere/eachKV.git"},"version":"1.0.0","main":"index.js","bugs":{"email":"sophtwhere@icloud.com"},"homepage":"https://github.com/sophtwhere/eachKV","_id":"eachkv@1.0.0","_shasum":"e1147d1f7478471ceb7f0a6dde3fad25e56bcfe4","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"sophtwhere","email":"sophtwhere@icloud.com"},"maintainers":[{"name":"sophtwhere","email":"sophtwhere@icloud.com"}],"dist":{"shasum":"e1147d1f7478471ceb7f0a6dde3fad25e56bcfe4","tarball":"https://registry.npmjs.org/eachkv/-/eachkv-1.0.0.tgz","integrity":"sha512-S9cwkjWXuoniU6JuTiDOSxXFwu9gBE9UrFLKVhdp07pPL/98e21NAraHeskixXY/moxrCAu9lC7/ru2VazuB/A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDoYzx4KrVWwuWgz9D0gLgOz7GQhhTgToYfwPwl7Wqc+QIgH7pX5WLPPvSxYHTpBK/+meySdsSi3Ju7tJn7JZUsX3s="}]}},"1.0.1":{"name":"eachkv","description":"key and value iteration for javascript arrays","author":{"name":"Jonathan Annett","email":"sophtwhere@icloud.com","url":"https://github.com/sophtwhere"},"repository":{"type":"git","url":"https://github.com/sophtwhere/eachKV.git"},"version":"1.0.1","main":"index.js","bugs":{"email":"sophtwhere@icloud.com"},"homepage":"https://github.com/sophtwhere/eachKV","_id":"eachkv@1.0.1","_shasum":"717c9dbb77e79c503c6c4f455e39a2e17e3fe81f","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"sophtwhere","email":"sophtwhere@icloud.com"},"maintainers":[{"name":"sophtwhere","email":"sophtwhere@icloud.com"}],"dist":{"shasum":"717c9dbb77e79c503c6c4f455e39a2e17e3fe81f","tarball":"https://registry.npmjs.org/eachkv/-/eachkv-1.0.1.tgz","integrity":"sha512-jl8h38A4SgwhnNQSK1YFHWMuGoXGtVGFPrEzgThla43soEBfD3gwGPSP0dxxvGFdvWS55tsbtVcIUoB9KA7nyQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGzG5jDZhkSU07MZJtthQfWWVw92SBLLT2jVPMzejxGjAiEA6TIUdIqbgWKW5JlgjIoXRQteCyUg8dybBdvEFibDCWs="}]}},"1.0.2":{"name":"eachkv","description":"key and value iteration for javascript arrays","author":{"name":"Jonathan Annett","email":"sophtwhere@icloud.com","url":"https://github.com/sophtwhere"},"repository":{"type":"git","url":"https://github.com/sophtwhere/eachKV.git"},"version":"1.0.2","main":"index.js","bugs":{"email":"sophtwhere@icloud.com"},"homepage":"https://github.com/sophtwhere/eachKV","_id":"eachkv@1.0.2","_shasum":"717c9dbb77e79c503c6c4f455e39a2e17e3fe81f","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"sophtwhere","email":"sophtwhere@icloud.com"},"maintainers":[{"name":"sophtwhere","email":"sophtwhere@icloud.com"}],"dist":{"shasum":"8e7c76c2f2da98abd680f1e91d2a23d199bb0a90","tarball":"https://registry.npmjs.org/eachkv/-/eachkv-1.0.2.tgz","integrity":"sha512-jg7kfS9agbZcCk8NdhwulDeHJSgGvlwHbjTWDnvybkEGgSsen3/Y2KNYaAIeXv+P5Fyg3S5+ywABljsLVq/G7A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF5UzE4iC6XVIIIUbm1q6rSkMJbGGDeOSN1fpbwOJ3jlAiAl3rRIXkAFT+6pItaY8+EGhMAXYL196jzi0pdMgvWkaw=="}]}},"1.0.3":{"name":"eachkv","description":"key and value iteration for javascript arrays","author":{"name":"Jonathan Annett","email":"sophtwhere@icloud.com","url":"https://github.com/sophtwhere"},"repository":{"type":"git","url":"https://github.com/sophtwhere/eachKV.git"},"version":"1.0.3","main":"index.js","bugs":{"email":"sophtwhere@icloud.com"},"homepage":"https://github.com/sophtwhere/eachKV","_id":"eachkv@1.0.3","_shasum":"717c9dbb77e79c503c6c4f455e39a2e17e3fe81f","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"sophtwhere","email":"sophtwhere@icloud.com"},"maintainers":[{"name":"sophtwhere","email":"sophtwhere@icloud.com"}],"dist":{"shasum":"9c9d6aabdd18a8fbcc6709e7b627b624b4331c9e","tarball":"https://registry.npmjs.org/eachkv/-/eachkv-1.0.3.tgz","integrity":"sha512-+q7FKJiITdaeRPFq4+ZfpIzcGhKnVEGM9yhE4Yvp9uWy4PWoeUfdRGtKA/RhHp3YETGK42bmNo+zU/WxFVJmCA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8037nSgi+eqUq3CKbjBshfDlSKFt6+tvS/7TzA//rVgIgf6bTZuoML9WzUOUnE/CnC/Ya8FNdOXbRvdE3hLXrtkk="}]}},"1.0.4":{"name":"eachkv","description":"key and value iteration for javascript arrays","author":{"name":"Jonathan Annett","email":"sophtwhere@icloud.com","url":"https://github.com/sophtwhere"},"repository":{"type":"git","url":"https://github.com/sophtwhere/eachKV.git"},"version":"1.0.4","main":"index.js","bugs":{"email":"sophtwhere@icloud.com"},"homepage":"https://github.com/sophtwhere/eachKV","_id":"eachkv@1.0.4","_shasum":"717c9dbb77e79c503c6c4f455e39a2e17e3fe81f","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"sophtwhere","email":"sophtwhere@icloud.com"},"maintainers":[{"name":"sophtwhere","email":"sophtwhere@icloud.com"}],"dist":{"shasum":"39419a72268f55c6d25555d7c80172eef8c778eb","tarball":"https://registry.npmjs.org/eachkv/-/eachkv-1.0.4.tgz","integrity":"sha512-LTEQe7AodcZO2eEZ7xsO4hqVxU4Frlci332Jc9k0BTfCgg8YqidkzZQ2V6ESTQiH5m83Q6tdH8I/Hh/igzVWrw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCP0VGvWfCv61d+JceMx80DfmI9KcjoCjMo+vo48rAi0QIhAM011T1lHGJ28n2BJ4q9cxK7FWbEIX5NEpgxMSDl3fOv"}]}},"1.0.5":{"name":"eachkv","description":"key and value iteration for javascript arrays","author":{"name":"Jonathan Annett","email":"sophtwhere@icloud.com","url":"https://github.com/sophtwhere"},"repository":{"type":"git","url":"https://github.com/sophtwhere/eachKV.git"},"version":"1.0.5","main":"index.js","bugs":{"email":"sophtwhere@icloud.com"},"homepage":"https://github.com/sophtwhere/eachKV","_id":"eachkv@1.0.5","_shasum":"7309d244b711a37a6fd5e1203e328c7465d47dd8","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"sophtwhere","email":"sophtwhere@icloud.com"},"maintainers":[{"name":"sophtwhere","email":"sophtwhere@icloud.com"}],"dist":{"shasum":"7309d244b711a37a6fd5e1203e328c7465d47dd8","tarball":"https://registry.npmjs.org/eachkv/-/eachkv-1.0.5.tgz","integrity":"sha512-DwPHJGnUTLv9wkEJJ7ryMAvZAcr+52dEnqFDXhckIkusrIOmLwxBKrSnWrSO9CZmlMojXHwY5DevlNglneu4ZA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAEmCi8zlXmm9lykjKFVl7QM1mSBDbIwTjoJoJvr0MYUAiAWMInFKp2e6cZuGHvndDvfdpQXDHqI5KJM6AkCQ81GZQ=="}]}},"1.0.6":{"name":"eachkv","description":"key and value iteration for javascript arrays","author":{"name":"Jonathan Annett","email":"sophtwhere@icloud.com","url":"https://github.com/sophtwhere"},"repository":{"type":"git","url":"https://github.com/sophtwhere/eachKV.git"},"version":"1.0.6","main":"index.js","bugs":{"email":"sophtwhere@icloud.com"},"homepage":"https://github.com/sophtwhere/eachKV","_id":"eachkv@1.0.6","_shasum":"2eac27119c6d320b137229cec9728f6d768f51d7","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"sophtwhere","email":"sophtwhere@icloud.com"},"maintainers":[{"name":"sophtwhere","email":"sophtwhere@icloud.com"}],"dist":{"shasum":"2eac27119c6d320b137229cec9728f6d768f51d7","tarball":"https://registry.npmjs.org/eachkv/-/eachkv-1.0.6.tgz","integrity":"sha512-YQjlwrqYvfKsYheeBb/izZ0wKHxjUjSsAhlMDdGyDmGNtCD6+VBys5uZoo7mVqyL0wSToVhhTVE3SSB42SaqIQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDn40+IPUpEXEEl31XhcYuobH+cC/FPoIxFrRWC6Je3hwIhALJabKWPil57tcnggu4KhXZxjt0JNVnPwo02Ht5mboyp"}]}},"1.0.7":{"name":"eachkv","description":"key and value iteration for javascript arrays","author":{"name":"Jonathan Annett","email":"sophtwhere@icloud.com","url":"https://github.com/sophtwhere"},"repository":{"type":"git","url":"https://github.com/sophtwhere/eachKV.git"},"version":"1.0.7","main":"index.js","bugs":{"email":"sophtwhere@icloud.com"},"homepage":"https://github.com/sophtwhere/eachKV","_id":"eachkv@1.0.7","_shasum":"27371c124a2b1e710d0f2aa9414deae2d10c86f2","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"sophtwhere","email":"sophtwhere@icloud.com"},"maintainers":[{"name":"sophtwhere","email":"sophtwhere@icloud.com"}],"dist":{"shasum":"27371c124a2b1e710d0f2aa9414deae2d10c86f2","tarball":"https://registry.npmjs.org/eachkv/-/eachkv-1.0.7.tgz","integrity":"sha512-1Tr+NCsOSCMaO5DQHRKHmA0OklhZXKTmBz5jkVwo7QZUKpNLXAt31YnYklTYLTmFfI1XloSWShmA3cmRlx2izA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCro6dV33ga3g2+wFwH+ku/oW7W093zqpYSaUXJoV7yxgIgQrYXcCbJfUdUFcT0EXACHmbDi/tbnXiZCT5reJjXNjs="}]}},"1.0.8":{"name":"eachkv","description":"key and value iteration for javascript arrays","author":{"name":"Jonathan Annett","email":"sophtwhere@icloud.com","url":"https://github.com/sophtwhere"},"repository":{"type":"git","url":"https://github.com/sophtwhere/eachKV.git"},"version":"1.0.8","main":"index.js","bugs":{"email":"sophtwhere@icloud.com"},"homepage":"https://github.com/sophtwhere/eachKV","_id":"eachkv@1.0.8","_shasum":"66ba1d8a43f0a773a6d2cb152fc425d42585389a","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"sophtwhere","email":"sophtwhere@icloud.com"},"maintainers":[{"name":"sophtwhere","email":"sophtwhere@icloud.com"}],"dist":{"shasum":"66ba1d8a43f0a773a6d2cb152fc425d42585389a","tarball":"https://registry.npmjs.org/eachkv/-/eachkv-1.0.8.tgz","integrity":"sha512-Qm5gI9e9W0SA4KV0IKO4vGncwH0+ojL7UHqB0VHLZLVjWExmUTUfK4oAAxZzBP8mmw/RQiNSgoForwmOMjs+pQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQClKeUZrTVSU7N9LLO8X5pjWjuJvHgoCcg/xGWm1rBjPgIgVCE/QhwKTBCNzibI1TQ9/HH87AjcEKJIWcNzFdkuMDM="}]}},"1.0.9":{"name":"eachkv","description":"key and value iteration for javascript arrays","author":{"name":"Jonathan Annett","email":"sophtwhere@icloud.com","url":"https://github.com/sophtwhere"},"repository":{"type":"git","url":"https://github.com/sophtwhere/eachKV.git"},"version":"1.0.9","main":"index.js","bugs":{"email":"sophtwhere@icloud.com"},"homepage":"https://github.com/sophtwhere/eachKV","_id":"eachkv@1.0.9","_shasum":"6a4dcb3a917b2c03ad4158a7e7279b82a7347fae","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"sophtwhere","email":"sophtwhere@icloud.com"},"maintainers":[{"name":"sophtwhere","email":"sophtwhere@icloud.com"}],"dist":{"shasum":"6a4dcb3a917b2c03ad4158a7e7279b82a7347fae","tarball":"https://registry.npmjs.org/eachkv/-/eachkv-1.0.9.tgz","integrity":"sha512-5tNMD1kfcEDrggtzY4B2ELnKwZx35b3t1+L7Khq1Ke4HXxGDe+LYyC5oFApDZLie/fs9N0gYQovnyeE43Q92mA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3x5FsMx6xgX3WyFZBqwMdj6TP/GMIEp8JBuq98Ef1QAIgbQM9ob0DgFjks+7xdX6CXtKRswqMT0nyNbKVgdvVu4I="}]}},"1.0.10":{"name":"eachkv","description":"key and value iteration for javascript arrays","author":{"name":"Jonathan Annett","email":"sophtwhere@icloud.com","url":"https://github.com/sophtwhere"},"repository":{"type":"git","url":"https://github.com/sophtwhere/eachKV.git"},"version":"1.0.10","main":"index.js","bugs":{"email":"sophtwhere@icloud.com"},"homepage":"https://github.com/sophtwhere/eachKV","_id":"eachkv@1.0.10","_shasum":"f9f167b6354ac462b5037ebb64414da5f3954b78","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"sophtwhere","email":"sophtwhere@icloud.com"},"maintainers":[{"name":"sophtwhere","email":"sophtwhere@icloud.com"}],"dist":{"shasum":"f9f167b6354ac462b5037ebb64414da5f3954b78","tarball":"https://registry.npmjs.org/eachkv/-/eachkv-1.0.10.tgz","integrity":"sha512-hiHxf+QCSV3Q1fq5TgSes4MJYHE8Ae3X5sCGLv3/cf5dZGqsOygw5pHLTGbhJ5KoHR8eJcMp30qNFRXdUc+i8g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDjxKfWQ0yIj+DoeLOC+f3+Bm8ofTi+LSV9mjHiaQLX4AiEAnhO631WuvzxVlZBxDLWayrbrtOOpqW4qDByCS5IWZZI="}]}},"1.0.11":{"name":"eachkv","description":"key and value iteration for javascript arrays","author":{"name":"Jonathan Annett","email":"sophtwhere@icloud.com","url":"https://github.com/sophtwhere"},"repository":{"type":"git","url":"https://github.com/sophtwhere/eachKV.git"},"version":"1.0.11","main":"index.js","bugs":{"email":"sophtwhere@icloud.com"},"homepage":"https://github.com/sophtwhere/eachKV","_id":"eachkv@1.0.11","_shasum":"3ba9708e66ec7ab9da2052518fd921e32f1a6baa","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"sophtwhere","email":"sophtwhere@icloud.com"},"maintainers":[{"name":"sophtwhere","email":"sophtwhere@icloud.com"}],"dist":{"shasum":"3ba9708e66ec7ab9da2052518fd921e32f1a6baa","tarball":"https://registry.npmjs.org/eachkv/-/eachkv-1.0.11.tgz","integrity":"sha512-bIQStLzhRoUEQ7iCHglDn7nwfPxG43NUSMETDPWXnDFtYKpAnd99evrN7+0xEqZEr+6LAZNldK9+nDfDPBVIMA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICR0i6R04HfmQD9Xki8xAF3z9fJ/1oUmLu6vN2TG9TSNAiEA6sEQvoLqZGezre3cmSFUsdNgvCz7lar5c46k1GyiiVI="}]}}},"readme":"key/value iteration for javascript Objects\n====\n\n(ignores any **`Object.prototype.xxx = `** items)\n\nInstalling\n----\n\n\n```\nnpm install eachkv\n\n```\n\n\nAuto require syntax:\n----\nYou can optionally auto require both functions in the local scope with one line:\n\n```\neval(require('eachkv')());\n```\nThis expands out to the equivalent of:\n\n```\nvar $eachKVAsync$=require('eachkv').$eachKVAsync$;\nvar $eachKV$=require('eachkv').$eachKV$;\n````\n\n\n$eachKV$ (basic synchronous looping)\n----\n\n**Generic Synchronous Sytnax:**\n\n\n```\neval(require('eachkv')());\n\n$eachKV$(\n    elements,\n    function onKeyValue (key,value,endLoop){\n\n    },\n    function ondone(retval) {\n\n    }\n)\n```\n\nWhilst this is a synchronous function, it uses callbacks for 2 reasons.\n\nFirstly, to facilitate returning a value from a loop, and exiting the loop early. why not just use a for (var x in array) loop? because $eachKV automatically decodes the array[x] value for you, and helpfully ignores any prototype extending functions that have been added to Object. (it still lets you iterate normal functions if that's what you want to do.)\n\nSecondly, to get you into the habit of structuring your loops this way, so if you need to switch to an async model, it is very easy.\n\n**The return value**\n\nMost of the time you can ignore the return value, however, if you want to exit a loop early, remembering where you were, or something you were looping to find, you can pass it into endLoop(). this will cause that value to be returned to either the ondone() callback, or if you did not define one, the immediate caller. see the second example for one way to use this. \n\n*Salient points:*\n\n  * if no items were iterated, or **endLoop()** is never called, the return value is null.\n  * if no iterms were iterated, or **endLoop()** is never called, **ondone(null)** is called at the end of the loop\n  * inside iterator function, if the **endLoop()** callback was called, the **ondone()** callback is called with that value, and $eachKV$ returns **undefined**\n  * otherwise, if the **endLoop()** callback was called, $eachKV$ returns whatever was passed into **endLoop()**\n\n\n\n**simple example using standard array** \nno return values, you just want to loop.\n\n```\neval(require('eachkv')());\n\n\nvar elements = [\"one\",\"small\",\"step\",\"for\",\"a\",\"man\"];\n\n$eachKV$(\n    elements,\n    function onKeyValue (n,word,endLoop){\n        console.log(\"word #\",n+1,\"is\",word);\n    }\n)\n```\n\n\n**synchronous example using named array** \n\n```\n\neval(require('eachkv')());\n\nvar total = 0, elements = { fish : 20, chicken : 45, oats : 39 };\n\nif ($eachKV$(\n\n    elements,\n    function onKeyValue (key,value,endLoop){\n        if (value > 99) {\n            endLoop(key);\n        } else {\n            total += value;\n            console.log(\"Updating total for\",key,\"+ $\"+value,\"=$\"+total);\n        }\n    },\n    function ondone(retval) {\n        if (retval) {\n            console.log(retval,\"is too high ($\"+elements[retval],\")\");\n        } else {\n            console.log(\"The shopping cart total is $\", total);\n        }\n    }\n) ===undefined) {\n    // we got a hit.\n    console.log(\"shopping aborted due to something being too expensive\");\n}\n```\n\n\n\n\n\n$eachKVAsync$ (asynchronous looping)\n----\n\nExpanding on **$eachKV$**, **$eachKVAsync$** adds a **nextItem()** callback and an **info** parameter.\n\n**nextItem()** advances to the next item - if you don't call it, your loops stops, so remember to ensure it's called at least once for each iteration.\n\n**endLoop** is the same as before, however the return value of **$eachKVAsync$** is *always* null. your **afterLastItem()** callback needs to collect anything it needs out of info before proceeeding.\n\n**loopEndedEarly** tells you that \n\n**info** is ignoreed by the **$eachKVAsync$** itself, but is passed around everywhere for you to use as a container for variables etc. you can equally leave it undefined or null, and this will work too. and you can replace it's value each time if really want to, to set up a new value for the next iteration. it's up to you.\n\n\n**Generic Asynchronous Sytnax:**\n\n```\neval(require('eachkv')());\n\n\n$eachKVAsync$(\n\t  elements,\n\t  info,\n\t  function onItem(key, value, info, nextItem, endLoop) {\n\t  \n\t  \t\tif (must_exit===true) {\n\t  \t\t   endLoop(info);\n\t  \t\t}\n\n\t\t\tnextItem(info)\t\t\n\t  },\n\t  function afterLastItem(info, loopEndedEarly) {\n\t      if (!loopEndedEarly) {\n\t\n\t      }\n\t  }\n)\n```\n\n\n\n\n\n\n**Asynchronous example using indexed array** \n\nThis just prints out the sizes of the files.\n\n```\neval(require('eachkv')());\n\nvar info  = {\n    total : 0,\n    count : 0,\n    folder :\n    require(\"path\").resolve(module.filename).split(\"/\").\n    reverse().slice(1).reverse().join(\"/\")\n};\n\nrequire(\"fs\").readdir(\n\n    info.folder,\n\n    function(err,files) {\n        if (err) throw err;\n\n        $eachKVAsync$(\n            files,\n            info,\n            function onFile(i, filename, info, nextFile, endLoop) {\n                if (filename.charAt(0) === '.') {\n                    nextFile(info);\n                } else {\n                    \n                    require(\"fs\").stat(info.folder + \"/\" + filename,\n                        function (err, stat) {\n                            if (err) throw err;\n\n                            console.log(filename, \"is\", stat.size, \"bytes\")\n                            info.count++;\n                            info.total += stat.size;\n                            nextFile(info);\n                        }\n                    )\n                }\n            },\n            function afterLastFile(info, loopEndedEarly) {\n                if (!loopEndedEarly) {\n                    console.log(\"total of\",info.total,\"bytes in\",info.count,\"files\");\n                }\n            }\n        )\n    }\n)\n\n```\n\n**Bonus feature & example:**\n====\n\nThe automatic installer feature is reusable, and uses $eachKV$ to iterate the functions and build an \"install script\". you can have a look at that to see another way to use it.\n\nif you are going to be using $eachKVAsync$ anyway, you can use it to provide the same easy install as follows:\n\n```\nmodule.exports = function (options) {\n    return require('eachkv').installer(module,options);\n}\n```\n\nOr if you want to **exclude** something for some reason:\n\n\n```\n//Pull in the installer & $eachKV$ tools…\neval(require('eachkv')({installer:true}));\n\nmodule.exports = function (options) {\n    var opt = options || {  };\n    if (opt.exclude) {\n        opt.exclude.push[\"notThisOne\"]\n    } else {\n        opt.exclude = [\"notThisOne\"];\n    }\n    return installer(module,opt);\n}\n```\n\nif your module only exports one function, which is the same name as the npm use this:\n\n```\nmodule.exports = function () {\n    return require('eachkv').installer(module,{complete:true});\n}\n```\n\nor to cherry pick a few functions to auto export, use this:\n\n```\neval(require('eachkv')({installer:true}));\n\nmodule.exports = function () {\n    return installer(module,{include:[\"func1\",\"func2\"]});\n}\n```\n\n**full options syntax:**\n\n*only install these functions*  \n```\n{\n  include : [\"a\",\"b\",\"c\"]\n}\n```\n\n*don't install these functions*  \n```\n{\n  exclude : [\"a\",\"z\"]\n}\n```\n\n*rename these functions*  \n```\n{\n  rename : {\"myCoolFunction\" : \"mcf\",\n  \"thisIstooLongANameForNormalUse\" : \"doit\"}\n}\n```\n\n*keep it simple stupid*  \n```\n{\ncomplete:true\n}\n```\n\nif you npm is called gizmo, this will just generate \n\n```\n if (!gizmo) {var gizmo=require(\"gizmo\");}\n```\n\n\n\n\n\n\n","maintainers":[{"name":"sophtwhere","email":"sophtwhere@icloud.com"}],"time":{"modified":"2022-06-16T03:12:33.643Z","created":"2014-06-29T15:44:00.930Z","1.0.0":"2014-06-29T15:44:00.930Z","1.0.1":"2014-06-29T15:50:49.143Z","1.0.2":"2014-06-29T16:01:00.002Z","1.0.3":"2014-06-30T06:18:22.179Z","1.0.4":"2014-07-01T05:40:44.700Z","1.0.5":"2014-07-01T14:33:41.045Z","1.0.6":"2014-07-02T10:18:19.096Z","1.0.7":"2014-07-02T11:22:15.304Z","1.0.8":"2014-07-03T12:47:29.452Z","1.0.9":"2014-07-05T04:06:24.604Z","1.0.10":"2014-07-28T04:17:38.669Z","1.0.11":"2014-07-28T04:29:13.551Z"},"homepage":"https://github.com/sophtwhere/eachKV","repository":{"type":"git","url":"https://github.com/sophtwhere/eachKV.git"},"author":{"name":"Jonathan Annett","email":"sophtwhere@icloud.com","url":"https://github.com/sophtwhere"},"bugs":{"email":"sophtwhere@icloud.com"},"readmeFilename":"readme.md"}