{"_id":"memoizesync","_rev":"25-a71ca53308bc39737cf7769f830fd952","name":"memoizesync","description":"Helper for memoizing synchronous functions and methods","dist-tags":{"latest":"1.1.1"},"versions":{"0.0.1":{"name":"memoizesync","version":"0.0.1","description":"Helper for memoizing synchronous functions and methods","main":"lib/memoizeSync.js","directories":{"test":"test"},"dependencies":{},"devDependencies":{"mocha":"=1.7.3","expect.js":"=0.2.0"},"scripts":{"prepublish":"mocha","test":"mocha"},"repository":{"type":"git","url":"git://github.com/papandreou/node-memoizesync.git"},"keywords":["memo","memoize","sync","cache"],"author":{"name":"Andreas Lind Petersen","email":"andreas@one.com"},"license":"BSD","_id":"memoizesync@0.0.1","dist":{"shasum":"0c65c36e5f6137fb2beccbd747c9300f1fc8eb1d","tarball":"https://registry.npmjs.org/memoizesync/-/memoizesync-0.0.1.tgz","integrity":"sha512-gX34/qUW+UtYvzO0m/wUUbFBwbMOEc/QyHQpxlK8wkrNsU/CsV247TEN+MrD3nXCkUYFbMPjzDnW8FVRGeob1A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGCnlFjP2ZpX55rznHQFjP8Xlfuaes3/5t7S9KR9NFEGAiEA24vr4uqw4HMCEKSjtnAhXxd1haZX6AePdn710nUiP0c="}]},"_npmVersion":"1.1.63","_npmUser":{"name":"papandreou","email":"andreas@one.com"},"maintainers":[{"name":"papandreou","email":"andreas@one.com"}]},"0.1.0":{"name":"memoizesync","version":"0.1.0","description":"Helper for memoizing synchronous functions and methods","main":"lib/memoizeSync.js","directories":{"test":"test"},"dependencies":{},"devDependencies":{"mocha":"=1.7.3","expect.js":"=0.2.0"},"scripts":{"prepublish":"mocha","test":"mocha"},"repository":{"type":"git","url":"git://github.com/papandreou/node-memoizesync.git"},"keywords":["memo","memoize","sync","cache"],"author":{"name":"Andreas Lind Petersen","email":"andreas@one.com"},"license":"BSD","_id":"memoizesync@0.1.0","dist":{"shasum":"b80f5eb2b69417d62792c22523ccdf71d6519f3b","tarball":"https://registry.npmjs.org/memoizesync/-/memoizesync-0.1.0.tgz","integrity":"sha512-68A+f1VpXsVWYvAG9NK+kQyeUiTn01K0WYzOz10GotN3ezVo4QoPyudNT+t5aJNOdt41/BUCaqLWUUhUE+jdMA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHwo0u6PG/PzyO6mIqshGAFKb9TEOek0KPjnDwGqEMABAiAcdzVNgFu/QOZZ1i8mTdgEb+b+Sd+s72pDxPRr9WbuFA=="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"papandreou","email":"andreas@one.com"},"maintainers":[{"name":"papandreou","email":"andreas@one.com"}]},"0.2.0":{"name":"memoizesync","version":"0.2.0","description":"Helper for memoizing synchronous functions and methods","main":"lib/memoizeSync.js","directories":{"test":"test"},"dependencies":{"lru-cache":"=2.3.1"},"devDependencies":{"mocha":"=1.7.3","expect.js":"=0.2.0"},"scripts":{"prepublish":"mocha","test":"mocha"},"repository":{"type":"git","url":"git://github.com/papandreou/node-memoizesync.git"},"keywords":["memo","memoize","sync","cache"],"author":{"name":"Andreas Lind Petersen","email":"andreas@one.com"},"license":"BSD","_id":"memoizesync@0.2.0","dist":{"shasum":"5e2a995aae4f95f4a0e544795051c61e85c2eed5","tarball":"https://registry.npmjs.org/memoizesync/-/memoizesync-0.2.0.tgz","integrity":"sha512-u9fWb/GuoeqDAO2FJ0OI3ePeaaOxIRoaML/ggas2FxdGNGIcgLuoDKOVQbAkBwRX7nYe+XoxvvGiscG8dy+Bfg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIQDmGqLuGKvKRUgdet22RFshLq+veHYpqBRySyhwy9YTuQIfS2SDJBzxer73Zo2xmySSbIwSIF9sSWobFgAnB351Qw=="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"papandreou","email":"andreas@one.com"},"maintainers":[{"name":"papandreou","email":"andreas@one.com"}]},"0.2.1":{"name":"memoizesync","version":"0.2.1","description":"Helper for memoizing synchronous functions and methods","main":"lib/memoizeSync.js","directories":{"test":"test"},"dependencies":{"lru-cache":"=2.3.1"},"devDependencies":{"mocha":"=1.7.3","expect.js":"=0.2.0"},"scripts":{"prepublish":"mocha","test":"mocha"},"repository":{"type":"git","url":"git://github.com/papandreou/node-memoizesync.git"},"keywords":["memo","memoize","sync","cache"],"author":{"name":"Andreas Lind Petersen","email":"andreas@one.com"},"license":"BSD","_id":"memoizesync@0.2.1","dist":{"shasum":"cc9e4b00e1958ab6d9d3fc98ad1acd2bd0d94393","tarball":"https://registry.npmjs.org/memoizesync/-/memoizesync-0.2.1.tgz","integrity":"sha512-N4ntV1ZDpdR2FcvK3YjkYWcij/QBBwPPDyOOrREDtd+CbFf9W6su9tJvOIjgfwVL1lbozzzMoJiRTt90iaUeJg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEwBHkPwrN2lYq8+kYckIFNn9h9vYpKMlWtJNItGHsXfAiEA1n88PwnxCaYeMJ/l+7WX8h3sEg18pToubKjamnGvPlI="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"papandreou","email":"andreas@one.com"},"maintainers":[{"name":"papandreou","email":"andreas@one.com"}]},"0.3.0":{"name":"memoizesync","version":"0.3.0","description":"Helper for memoizing synchronous functions and methods","main":"lib/memoizeSync.js","directories":{"test":"test"},"dependencies":{"lru-cache":"=2.3.1"},"devDependencies":{"mocha":"=1.13.0","unexpected":"=1.0.1"},"scripts":{"prepublish":"mocha","test":"mocha"},"repository":{"type":"git","url":"git://github.com/papandreou/node-memoizesync.git"},"keywords":["memo","memoize","sync","cache"],"author":{"name":"Andreas Lind Petersen","email":"andreas@one.com"},"license":"BSD","_id":"memoizesync@0.3.0","dist":{"shasum":"04a866650dd7b8686c6d6ed64f36c304aa22d735","tarball":"https://registry.npmjs.org/memoizesync/-/memoizesync-0.3.0.tgz","integrity":"sha512-22N2GZkzh7ev8u9/AHj60NlXffPo2VQ6lGtLs5ftjh9p7c2vO1kCcg/nzHIq0L+Yfgr4Qaj08W3n9Ke1pVYcDA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDtQL3OCDSquH0kZdBUYaRhjcakyrIVH7o53mq0ir2A6gIgKDoX9FS+ylJooaxu9yA/Rh0oVUl6Y1tQt9hpAGd5gyI="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"papandreou","email":"andreas@one.com"},"maintainers":[{"name":"papandreou","email":"andreas@one.com"}]},"0.4.0":{"name":"memoizesync","version":"0.4.0","description":"Helper for memoizing synchronous functions and methods","main":"lib/memoizeSync.js","directories":{"test":"test"},"dependencies":{"lru-cache":"=2.3.1"},"devDependencies":{"mocha":"=1.13.0","unexpected":"=1.0.1"},"scripts":{"prepublish":"mocha","test":"mocha"},"repository":{"type":"git","url":"git://github.com/papandreou/node-memoizesync.git"},"keywords":["memo","memoize","sync","cache"],"author":{"name":"Andreas Lind Petersen","email":"andreas@one.com"},"license":"BSD","_id":"memoizesync@0.4.0","dist":{"shasum":"157613eff3a8d904d6e70b3b1d6fa6fad054825d","tarball":"https://registry.npmjs.org/memoizesync/-/memoizesync-0.4.0.tgz","integrity":"sha512-3r2FbaiBao1bwDAW7wEzRV2IsBg2kLgae0liks/eX27QGF1N6SZZZMRuOvulxzVqSyZvtuQk+VZAHYYLYLUj3A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGmIYLuVRIlUWVnSzbb1jIYSiL8mmqEVjbqsXugi+fu3AiBqOh8gnx7kyfU9BI5suNLCt0DPukZcHb+yd8jIT3m/1Q=="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"papandreou","email":"andreas@one.com"},"maintainers":[{"name":"papandreou","email":"andreas@one.com"}]},"0.4.1":{"name":"memoizesync","version":"0.4.1","description":"Helper for memoizing synchronous functions and methods","main":"lib/memoizeSync.js","directories":{"test":"test"},"dependencies":{"lru-cache":"=2.3.1"},"devDependencies":{"mocha":"=1.13.0","unexpected":"=1.0.1"},"scripts":{"prepublish":"mocha","test":"mocha"},"repository":{"type":"git","url":"git://github.com/papandreou/node-memoizesync.git"},"keywords":["memo","memoize","sync","cache"],"author":{"name":"Andreas Lind Petersen","email":"andreas@one.com"},"license":"BSD","_id":"memoizesync@0.4.1","dist":{"shasum":"538900a02b53d33fb720efd724f50a76fea04b73","tarball":"https://registry.npmjs.org/memoizesync/-/memoizesync-0.4.1.tgz","integrity":"sha512-lkG8nqeGPJhN+Bxitj19tSMW8U4iOdq84zriWul9Rs7E3fA+YU9UqMXzcSU4jRJZZUg0R/yHtMWFFAFTjLckGw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEyouPOcHv5JlklSQs5ppY+PsGv7DqYqGsZXkd0rSnBkAiEA/CIcQzuC2sBsDcRdWv/Af0IdWJj7VRTV5pohsSGyHh4="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"papandreou","email":"andreas@one.com"},"maintainers":[{"name":"papandreou","email":"andreas@one.com"}]},"0.4.2":{"name":"memoizesync","version":"0.4.2","description":"Helper for memoizing synchronous functions and methods","main":"lib/memoizeSync.js","directories":{"test":"test"},"dependencies":{"lru-cache":"=2.3.1"},"devDependencies":{"mocha":"=1.13.0","unexpected":"=1.0.1"},"scripts":{"prepublish":"mocha","test":"mocha"},"repository":{"type":"git","url":"git://github.com/papandreou/node-memoizesync.git"},"keywords":["memo","memoize","sync","cache"],"author":{"name":"Andreas Lind Petersen","email":"andreas@one.com"},"license":"BSD","_id":"memoizesync@0.4.2","dist":{"shasum":"3f34eb3cb4b76f5f6440d91c01f25125e9462b49","tarball":"https://registry.npmjs.org/memoizesync/-/memoizesync-0.4.2.tgz","integrity":"sha512-C7fPBIpLggPwuMonphZrCIBjlvMNFW3LPloOeORsRGGJu38QWb/oPGE1zzsDzZpxxgHICx+BmeviMRKgAOyuyA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCewOqbJvjHj3XDrvQgR9tpS7LDBRwl2F76pv3z80oXXAIgP048yND2g9XuNKH51eblpmswk0GZZoqtS4MMfwhLC5M="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"papandreou","email":"andreas@one.com"},"maintainers":[{"name":"papandreou","email":"andreas@one.com"}]},"0.5.0":{"name":"memoizesync","version":"0.5.0","description":"Helper for memoizing synchronous functions and methods","main":"lib/memoizeSync.js","directories":{"test":"test"},"dependencies":{"lru-cache":"=2.3.1"},"devDependencies":{"mocha":"=1.18.2","unexpected":"=3.1.5"},"scripts":{"prepublish":"mocha","test":"mocha"},"repository":{"type":"git","url":"git://github.com/papandreou/node-memoizesync.git"},"keywords":["memo","memoize","sync","cache"],"author":{"name":"Andreas Lind Petersen","email":"andreas@one.com"},"license":"BSD","bugs":{"url":"https://github.com/papandreou/node-memoizesync/issues"},"homepage":"https://github.com/papandreou/node-memoizesync","_id":"memoizesync@0.5.0","dist":{"shasum":"97e628514bd1fbaca66bdbe703129bbf24f477fd","tarball":"https://registry.npmjs.org/memoizesync/-/memoizesync-0.5.0.tgz","integrity":"sha512-WugmtE11wrj7B4Xr7zWyzjJ9dgq/aKknuPCIY4UTjwG9HeERxDaCcRbxwLjKBLx5xCCQ+S6L2GtvPJXRkuZEUg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZ3mL7The62AQmVtl05W5oArEtcJ236x6kKTyHcWCkLwIgXhtHTS8T+zzi0cB831JRGn2m+EJPEAeFaoMwdwv4Siw="}]},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"papandreou","email":"andreas@one.com"},"maintainers":[{"name":"papandreou","email":"andreas@one.com"}]},"0.4.3":{"name":"memoizesync","version":"0.4.3","description":"Helper for memoizing synchronous functions and methods","main":"lib/memoizeSync.js","directories":{"test":"test"},"dependencies":{"lru-cache":"=2.3.1"},"devDependencies":{"mocha":"=1.13.0","unexpected":"=1.0.1"},"scripts":{"prepublish":"mocha","test":"mocha"},"repository":{"type":"git","url":"git://github.com/papandreou/node-memoizesync.git"},"keywords":["memo","memoize","sync","cache"],"author":{"name":"Andreas Lind Petersen","email":"andreas@one.com"},"license":"BSD","gitHead":"b7443e9c25b711dd44027b241d4bd86eb9a0b5f3","bugs":{"url":"https://github.com/papandreou/node-memoizesync/issues"},"homepage":"https://github.com/papandreou/node-memoizesync#readme","_id":"memoizesync@0.4.3","_shasum":"9f5fbf9c82eaa3b49e301beba743f4cf87a8f5ec","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.0","_npmUser":{"name":"papandreou","email":"andreas@one.com"},"dist":{"shasum":"9f5fbf9c82eaa3b49e301beba743f4cf87a8f5ec","tarball":"https://registry.npmjs.org/memoizesync/-/memoizesync-0.4.3.tgz","integrity":"sha512-JcEP2ggYcLW6Wm9otkKPYwlaB6PspiKBOBiXnJa4d2otO6/8Lf78ZticBGhSJfcC/divU2KNlGSWlcMzB0FPOQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA8AvSwX61j7UyPF6dx1COvLZc2cA7WxDo3et8arhIO5AiEAsJ3Hab77aCfP0muLcUjTUIqntwMoVqg3AF73x4dz9hY="}]},"maintainers":[{"name":"papandreou","email":"andreas@one.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/memoizesync-0.4.3.tgz_1487590177109_0.5757597575429827"}},"1.0.0":{"name":"memoizesync","version":"1.0.0","description":"Helper for memoizing synchronous functions and methods","main":"lib/memoizeSync.js","directories":{"test":"test"},"dependencies":{"lru-cache":"=2.3.1"},"devDependencies":{"coveralls":"^2.11.16","eslint":"^3.15.0","eslint-config-onelint":"^2.0.0","mocha":"^3.2.0","nyc":"^10.1.2","unexpected":"^10.26.0"},"scripts":{"lint":"eslint .","test":"mocha","travis":"npm test && npm run lint && npm run coverage && <coverage/lcov.info coveralls","coverage":"NODE_ENV=development nyc --reporter lcov --reporter text -- mocha && echo google-chrome coverage/lcov-report/index.html"},"repository":{"type":"git","url":"git://github.com/papandreou/node-memoizesync.git"},"keywords":["memo","memoize","sync","cache"],"author":{"name":"Andreas Lind Petersen","email":"andreas@one.com"},"license":"BSD","gitHead":"86450f4e36ff4daea4022735b8ba75d4190b9eff","bugs":{"url":"https://github.com/papandreou/node-memoizesync/issues"},"homepage":"https://github.com/papandreou/node-memoizesync#readme","_id":"memoizesync@1.0.0","_shasum":"5ad537cd3039342d9288101da1eb8975b260c9e5","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.3.0","_npmUser":{"name":"papandreou","email":"andreas@one.com"},"dist":{"shasum":"5ad537cd3039342d9288101da1eb8975b260c9e5","tarball":"https://registry.npmjs.org/memoizesync/-/memoizesync-1.0.0.tgz","integrity":"sha512-K2iSzcPhAitpIhXBQ+ka70/VDkxu+2MSlZLhCuOc2PonxUF3kdcV3o97JoRhTpIFgbF0pVUq/PoxHFj4f8JCLA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZiD+Udmi93rNH7I6qeUSlXKzc//1eTy7c/BejxIPAEQIgcIsew1lffzpmB9ocG/FrUW3qjaYeI04zEOwFfpsVWgM="}]},"maintainers":[{"name":"papandreou","email":"andreas@one.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/memoizesync-1.0.0.tgz_1487595924493_0.299144220771268"}},"1.1.0":{"name":"memoizesync","version":"1.1.0","description":"Helper for memoizing synchronous functions and methods","main":"lib/memoizeSync.js","directories":{"test":"test"},"dependencies":{"lru-cache":"=2.3.1"},"devDependencies":{"coveralls":"^2.11.16","eslint":"^3.15.0","eslint-config-onelint":"^2.0.0","mocha":"^3.2.0","nyc":"^10.1.2","unexpected":"^10.26.0"},"scripts":{"lint":"eslint .","test":"mocha","travis":"npm test && npm run lint && npm run coverage && <coverage/lcov.info coveralls","coverage":"NODE_ENV=development nyc --reporter lcov --reporter text -- mocha && echo google-chrome coverage/lcov-report/index.html"},"repository":{"type":"git","url":"git://github.com/papandreou/node-memoizesync.git"},"keywords":["memo","memoize","sync","cache"],"author":{"name":"Andreas Lind Petersen","email":"andreas@one.com"},"license":"BSD","gitHead":"8db986264d637d204af2fe9403da65277ce6cbf5","bugs":{"url":"https://github.com/papandreou/node-memoizesync/issues"},"homepage":"https://github.com/papandreou/node-memoizesync#readme","_id":"memoizesync@1.1.0","_shasum":"77ca53b9353681e01829058b5be81a1efb024135","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.10.0","_npmUser":{"name":"papandreou","email":"andreas@one.com"},"dist":{"shasum":"77ca53b9353681e01829058b5be81a1efb024135","tarball":"https://registry.npmjs.org/memoizesync/-/memoizesync-1.1.0.tgz","integrity":"sha512-9tMnxuVSuF5tFpEHPm2KUMhNOqaek5jGbjjzDtQ/nmnUoPB8UkDCcMuSfwzbyZxdodu+dafhd+4wLmVzauBFmw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAr4nosGxo3nWtOKz8vXH9zQNJkNcj0GSJWHAxQcfMTxAiEAhfWa3AmKkOdYYJbB5yqo5xUGwLV9LT1bQ6BftEACCpg="}]},"maintainers":[{"name":"papandreou","email":"andreas@one.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/memoizesync-1.1.0.tgz_1514411447643_0.9937050559092313"}},"1.1.1":{"name":"memoizesync","version":"1.1.1","description":"Helper for memoizing synchronous functions and methods","main":"lib/memoizeSync.js","directories":{"test":"test"},"dependencies":{"lru-cache":"=2.3.1"},"devDependencies":{"coveralls":"^2.11.16","eslint":"^3.15.0","eslint-config-onelint":"^2.0.0","mocha":"^3.2.0","nyc":"^10.1.2","unexpected":"^10.26.0"},"scripts":{"lint":"eslint .","test":"mocha","travis":"npm test && npm run lint && npm run coverage && <coverage/lcov.info coveralls","coverage":"NODE_ENV=development nyc --reporter lcov --reporter text -- mocha && echo google-chrome coverage/lcov-report/index.html"},"repository":{"type":"git","url":"git://github.com/papandreou/node-memoizesync.git"},"keywords":["memo","memoize","sync","cache"],"author":{"name":"Andreas Lind Petersen","email":"andreas@one.com"},"license":"BSD","gitHead":"6978116db1c1988118d532ac82fe4a8676b71884","bugs":{"url":"https://github.com/papandreou/node-memoizesync/issues"},"homepage":"https://github.com/papandreou/node-memoizesync#readme","_id":"memoizesync@1.1.1","_shasum":"01c09f0e2cf20a6349163eab05e51f9bd1e13fe1","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.10.0","_npmUser":{"name":"papandreou","email":"andreas@one.com"},"dist":{"shasum":"01c09f0e2cf20a6349163eab05e51f9bd1e13fe1","tarball":"https://registry.npmjs.org/memoizesync/-/memoizesync-1.1.1.tgz","integrity":"sha512-EEVBhL1Nnjbaauc4iUvPKZtQmV3NzSQJmjbzPswG1ZMGP/pVb+GdVzHOx5a+s+71qCDn8tbhKOxkyVVBC6cvmQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCVaB8YitHB8oyi0JMAhh4BPkRmIo48HYObyX+uqAq8oQIgF5VoaTpkCnQKmcnvJl+3sJfZ1hJr/rmvbsqbTnnu/QA="}]},"maintainers":[{"name":"papandreou","email":"andreas@one.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/memoizesync-1.1.1.tgz_1514411639985_0.46434060484170914"}}},"readme":"node-memoizesync\n================\n\nYet another memoizer for synchronous functions.\n\n[![NPM version](https://badge.fury.io/js/memoizesync.png)](http://badge.fury.io/js/memoizesync)\n[![Build Status](https://travis-ci.org/papandreou/node-memoizesync.svg?branch=master)](https://travis-ci.org/papandreou/node-memoizesync)\n[![Coverage Status](https://coveralls.io/repos/papandreou/node-memoizesync/badge.png)](https://coveralls.io/r/papandreou/node-memoizesync)\n[![Dependency Status](https://david-dm.org/papandreou/node-memoizesync.png)](https://david-dm.org/papandreou/node-memoizesync)\n\n```javascript\nvar memoizeSync = require('memoizesync');\n\nfunction myExpensiveComputation(arg1, arg2) {\n    // ...\n    return result;\n}\n\nvar memoized = memoizeSync(myExpensiveComputation, options);\n```\n\nNow `memoized` works exactly like `myExpensiveComputation`, except that\nthe actual computation is only performed once for each unique set of\narguments:\n\n```javascript\nvar result = memoized(42, 100);\n// Got the result!\n\nvar result2 = memoized(42, 100);\n// Got the same result, and much faster this time!\n```\n\nThe function returned by `memoizeSync` invokes the wrapped function\nin the context it's called in itself, so `memoizeSync` even works for\nmemoizing a method that has access to instance variables:\n\n```javascript\nfunction Foo(name) {\n    this.name = name;\n\n    this.myMethod = memoizeSync(function (arg1, arg2) {\n        console.log(\"Cool, this.name works here!\", this.name);\n        // ...\n        return \"That was tough, but I'm done now!\";\n    });\n}\n```\n\n(Unfortunately setting `Foo.prototype.myMethod = memoizeSync(...)`\nwouldn't work as the memoizer would be shared among all instances of\n`Foo`).\n\nTo distinguish different invocations (whose results need to be cached\nseparately) `memoizeSync` relies on a naive stringification of the\narguments, which is looked up in an internally kept hash. If the\nfunction you're memoizing takes non-primitive arguments you might want\nto provide a custom `argumentsStringifier` in the options argument to\n`memoizeSync`. Otherwise all object arguments will be considered equal\nbecause they stringify to `[object Object]`:\n\n```javascript\nvar memoized = memoizeSync(function functionToMemoize(obj) {\n    // ...\n    return Object.keys(obj).join('');\n}, {\n    argumentsStringifier: function (args) {\n        return args.map(function (arg) {return JSON.stringify(arg);}).join(\",\");\n    }\n);\n\nmemoized({foo: 'bar'}); // 'foo'\n\nmemoized({quux: 'baz'}); // 'quux'\n```\n\nHad the custom `argumentsStringifier` not been provided, the memoized\nfunction would would have returned `foo` both times.\n\nIf the `argumentsStringifier` returns false, the cache will be bypassed.\n\nCheck out <a\nhref=\"https://github.com/papandreou/node-memoizesync/blob/master/test/memoizeSync.js\">the\ncustom argumentsStringifier test</a> for another example.\n\n\n### Purging and expiring memoized values ###\n\nYou can forcefully clear a specific memoized value using the `purge`\nmethod on the memoizer:\n\n```javascript\nvar memoized = memoizeSync(function functionToMemoize(foo) {\n    // ...\n    return theResult;\n});\nvar foo = memoized(123);\nmemoized.purge(123);\nfoo = memoized(123); // Will be recomputed\n```\n\n`memoizer.purgeAll()` clears all memoized results.\n\nYou can also specify a custom ttl (in milliseconds) on the memoized\nresults:\n\n```javascript\nvar memoized = memoizeSync(function functionToMemoize() {\n    // ...\n    return theResult;\n}, {maxAge: 1000});\n```\n\nIn the above example the memoized value will be considered stale one\nsecond after it has been computed, and it will be recomputed next time\n`memoizeSync` is invoked with the same arguments.\n\n`memoizeSync` uses <a\nhref=\"https://github.com/isaacs/node-lru-cache\">node-lru-cache</a> to\nstore the memoized values, and it accepts the same parameters in the\n`options` object.\n\nIf you want to use the `length` option for lru-cache, note that the\nmemoized values are arrays: `[exception, returnValue]`.\n\n```javascript\nvar memoizedFsReadFileSync = memoizeSync(require('fs').readFileSync, {\n    max: 1000000,\n    length: function (exceptionAndReturnValue) {\n        if (exceptionAndReturnValue[0]) {\n            return 1;\n        } else {\n            var body = exceptionAndReturnValue[1];\n            return Buffer.isBuffer(body) ? body.length : Buffer.byteLength(body);\n        }\n    },\n    maxAge: 1000\n});\n```\n\nThe LRU instance is exposed in the `cache` property of the memoized\nfunction in case you need to access it.\n\nInstallation\n------------\n\nMake sure you have node.js and npm installed, then run:\n\n    npm install memoizesync\n\nBrowser compatibility\n---------------------\n\n`memoizeSync` uses the UMD wrapper, so it should also work in\nbrowsers. You should also have the <a\nhref=\"https://github.com/isaacs/node-lru-cache\">node-lru-cache</a>\nincluded:\n\n```html\n<script src=\"lru-cache.js\"></script>\n<script src=\"memoizeSync.js\"></script>\n<script>\n    var memoizedFunction = memoizeSync(function () {\n        // ...\n    });\n</script>\n```\n\n`lru-cache` uses `Object.defineProperty` and doesn't include an UMD\nwrapper, but if you define a `shims` config it should be possible to\nget it memoizeSync working with require.js, at least in newer browsers.\n\nLicense\n-------\n\n3-clause BSD license -- see the `LICENSE` file for details.\n","maintainers":[{"name":"papandreou","email":"andreas@one.com"}],"time":{"modified":"2022-06-19T17:45:31.897Z","created":"2012-12-12T23:27:40.214Z","0.0.1":"2012-12-12T23:27:42.377Z","0.1.0":"2013-04-03T21:52:56.299Z","0.2.0":"2013-08-27T21:19:01.098Z","0.2.1":"2013-09-06T22:13:08.057Z","0.3.0":"2013-10-06T16:31:00.143Z","0.4.0":"2013-10-06T18:17:11.313Z","0.4.1":"2013-10-06T18:30:27.757Z","0.4.2":"2013-10-06T21:28:24.375Z","0.5.0":"2014-04-26T20:53:35.550Z","0.4.3":"2017-02-20T11:29:39.065Z","1.0.0":"2017-02-20T13:05:25.084Z","1.1.0":"2017-12-27T21:50:48.518Z","1.1.1":"2017-12-27T21:54:00.082Z"},"author":{"name":"Andreas Lind Petersen","email":"andreas@one.com"},"repository":{"type":"git","url":"git://github.com/papandreou/node-memoizesync.git"},"homepage":"https://github.com/papandreou/node-memoizesync#readme","keywords":["memo","memoize","sync","cache"],"bugs":{"url":"https://github.com/papandreou/node-memoizesync/issues"},"license":"BSD","readmeFilename":"README.md"}