{ "_id": "mem", "_rev": "42-b05027cebcbf7d078309a69c3e498a01", "name": "mem", "description": "Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input", "dist-tags": { "latest": "8.0.0", "next": "7.0.0-3" }, "versions": { "0.1.0": { "name": "mem", "version": "0.1.0", "description": "Memoize functions - an optimization technique used to speed up consecutive function calls by caching the result of calls with identical inputs", "license": "MIT", "repository": { "type": "git", "url": "https://github.com/sindresorhus/mem" }, "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=0.10.0" }, "scripts": { "test": "xo && ava" }, "files": [ "index.js" ], "keywords": [ "memoize", "function", "mem", "memoization", "cache", "caching", "optimize", "performance", "ttl", "expire", "promise" ], "devDependencies": { "ava": "*", "delay": "^1.1.0", "xo": "*" }, "gitHead": "863a48adf8f83437383cdb3422a7c5d84f01654a", "bugs": { "url": "https://github.com/sindresorhus/mem/issues" }, "homepage": "https://github.com/sindresorhus/mem", "_id": "mem@0.1.0", "_shasum": "8aeb2b7a43e44d74c5cbbf5397e22255c747a5c2", "_from": ".", "_npmVersion": "2.14.7", "_nodeVersion": "4.2.1", "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, "dist": { "shasum": "8aeb2b7a43e44d74c5cbbf5397e22255c747a5c2", "tarball": "https://registry.npmjs.org/mem/-/mem-0.1.0.tgz" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "directories": {} }, "0.1.1": { "name": "mem", "version": "0.1.1", "description": "Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/mem.git" }, "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=0.10.0" }, "scripts": { "test": "xo && ava" }, "files": [ "index.js" ], "keywords": [ "memoize", "function", "mem", "memoization", "cache", "caching", "optimize", "performance", "ttl", "expire", "promise" ], "devDependencies": { "ava": "*", "delay": "^1.1.0", "xo": "*" }, "gitHead": "65d4ab7fb3b43b71b3c968eff65329c8ebb3eee8", "bugs": { "url": "https://github.com/sindresorhus/mem/issues" }, "homepage": "https://github.com/sindresorhus/mem#readme", "_id": "mem@0.1.1", "_shasum": "24df988c3102b03c074c1b296239c5b2e6647825", "_from": ".", "_npmVersion": "3.7.0", "_nodeVersion": "4.2.4", "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, "dist": { "shasum": "24df988c3102b03c074c1b296239c5b2e6647825", "tarball": "https://registry.npmjs.org/mem/-/mem-0.1.1.tgz" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "_npmOperationalInternal": { "host": "packages-9-west.internal.npmjs.com", "tmp": "tmp/mem-0.1.1.tgz_1454428396859_0.8970216677989811" }, "directories": {} }, "1.0.0": { "name": "mem", "version": "1.0.0", "description": "Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/mem.git" }, "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=4" }, "scripts": { "test": "xo && ava" }, "files": [ "index.js" ], "keywords": [ "memoize", "function", "mem", "memoization", "cache", "caching", "optimize", "performance", "ttl", "expire", "promise" ], "dependencies": { "mimic-fn": "^1.0.0" }, "devDependencies": { "ava": "*", "delay": "^1.1.0", "xo": "*" }, "xo": { "esnext": true }, "gitHead": "2d45828833f4ab36d60d87a4b5b8032c822b2f22", "bugs": { "url": "https://github.com/sindresorhus/mem/issues" }, "homepage": "https://github.com/sindresorhus/mem#readme", "_id": "mem@1.0.0", "_shasum": "cb8ca87e412dd14b68c8439069c6ee0f51ee99db", "_from": ".", "_npmVersion": "2.15.9", "_nodeVersion": "4.6.0", "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, "dist": { "shasum": "cb8ca87e412dd14b68c8439069c6ee0f51ee99db", "tarball": "https://registry.npmjs.org/mem/-/mem-1.0.0.tgz" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "_npmOperationalInternal": { "host": "packages-12-west.internal.npmjs.com", "tmp": "tmp/mem-1.0.0.tgz_1476898471266_0.8245243555866182" }, "directories": {} }, "1.1.0": { "name": "mem", "version": "1.1.0", "description": "Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/mem.git" }, "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=4" }, "scripts": { "test": "xo && ava" }, "files": [ "index.js" ], "keywords": [ "memoize", "function", "mem", "memoization", "cache", "caching", "optimize", "performance", "ttl", "expire", "promise" ], "dependencies": { "mimic-fn": "^1.0.0" }, "devDependencies": { "ava": "*", "delay": "^1.1.0", "xo": "*" }, "xo": { "esnext": true }, "gitHead": "c12270441fab7f42fe53cf97edd53c60c4a8268f", "bugs": { "url": "https://github.com/sindresorhus/mem/issues" }, "homepage": "https://github.com/sindresorhus/mem#readme", "_id": "mem@1.1.0", "_shasum": "5edd52b485ca1d900fe64895505399a0dfa45f76", "_from": ".", "_npmVersion": "2.15.9", "_nodeVersion": "4.6.0", "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, "dist": { "shasum": "5edd52b485ca1d900fe64895505399a0dfa45f76", "tarball": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "_npmOperationalInternal": { "host": "packages-12-west.internal.npmjs.com", "tmp": "tmp/mem-1.1.0.tgz_1476900325889_0.8028518599458039" }, "directories": {} }, "2.0.0": { "name": "mem", "version": "2.0.0", "description": "Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/mem.git" }, "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=4" }, "scripts": { "test": "xo && ava" }, "files": [ "index.js" ], "keywords": [ "memoize", "function", "mem", "memoization", "cache", "caching", "optimize", "performance", "ttl", "expire", "promise" ], "dependencies": { "mimic-fn": "^1.0.0", "p-is-promise": "^1.1.0" }, "devDependencies": { "ava": "*", "delay": "^2.0.0", "xo": "*" }, "gitHead": "009ce6a634d1f0d0a6cb0c93d1f59a17b8d6b2ed", "bugs": { "url": "https://github.com/sindresorhus/mem/issues" }, "homepage": "https://github.com/sindresorhus/mem#readme", "_id": "mem@2.0.0", "_npmVersion": "5.3.0", "_nodeVersion": "8.5.0", "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, "dist": { "integrity": "sha512-pbTjCfxCF9hnnypsdhIt6UWLYOfyigFGxyoy2iE+mj/VVde/HUUlbCwj/Ww6bIoFwjnFvyFQpiAUUWjH5mfLFw==", "shasum": "37b692533f101bec274c81a76c7bf4cd57fda89f", "tarball": "https://registry.npmjs.org/mem/-/mem-2.0.0.tgz" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/mem-2.0.0.tgz_1506321128100_0.6689927573315799" }, "directories": {} }, "3.0.0": { "name": "mem", "version": "3.0.0", "description": "Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/mem.git" }, "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=4" }, "scripts": { "test": "xo && ava" }, "files": [ "index.js" ], "keywords": [ "memoize", "function", "mem", "memoization", "cache", "caching", "optimize", "performance", "ttl", "expire", "promise" ], "dependencies": { "mimic-fn": "^1.0.0", "p-is-promise": "^1.1.0" }, "devDependencies": { "ava": "*", "delay": "^2.0.0", "xo": "*" }, "gitHead": "74439cc052c3bec1ec18b312f8913011dc262ed7", "bugs": { "url": "https://github.com/sindresorhus/mem/issues" }, "homepage": "https://github.com/sindresorhus/mem#readme", "_id": "mem@3.0.0", "_shasum": "84e58ad4dfbdf5d105b26b6548a398b2b3aa8a21", "_from": ".", "_npmVersion": "2.15.11", "_nodeVersion": "4.8.3", "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, "dist": { "shasum": "84e58ad4dfbdf5d105b26b6548a398b2b3aa8a21", "tarball": "https://registry.npmjs.org/mem/-/mem-3.0.0.tgz" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/mem-3.0.0.tgz_1507737373888_0.41107727540656924" }, "directories": {} }, "3.0.1": { "name": "mem", "version": "3.0.1", "description": "Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/mem.git" }, "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=4" }, "scripts": { "test": "xo && ava" }, "files": [ "index.js" ], "keywords": [ "memoize", "function", "mem", "memoization", "cache", "caching", "optimize", "performance", "ttl", "expire", "promise" ], "dependencies": { "mimic-fn": "^1.0.0", "p-is-promise": "^1.1.0" }, "devDependencies": { "ava": "*", "delay": "^2.0.0", "xo": "*" }, "gitHead": "16ff264ad0b1b7a2bfb8b8003dab2dc27c4d89d1", "bugs": { "url": "https://github.com/sindresorhus/mem/issues" }, "homepage": "https://github.com/sindresorhus/mem#readme", "_id": "mem@3.0.1", "_npmVersion": "5.6.0", "_nodeVersion": "8.11.2", "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, "dist": { "integrity": "sha512-QKs47bslvOE0NbXOqG6lMxn6Bk0Iuw0vfrIeLykmQle2LkCw1p48dZDdzE+D88b/xqRJcZGcMNeDvSVma+NuIQ==", "shasum": "152410d0d7e835e4a4363e626238d9e5be3d6f5a", "tarball": "https://registry.npmjs.org/mem/-/mem-3.0.1.tgz", "fileCount": 4, "unpackedSize": 6622, "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbKfZLCRA9TVsSAnZWagAA3UMP/19078JzW0g3A7kvikvK\nimhC+gJF3/+nRe/VFJ6uArsgrIpfSXLG/Qrth82B6UuHZXbGLgUAuwyFmtri\nQZ7pbE5gtAYAp30FxRjGf1sO0nbhNw4gZ34wbQ9rGIFFQOGoyun0FCW6KH+r\nOTT224SD78XjgEo2PXmb9lUI0VaSvoFqwqd+dHdaTkY6EelJqjVnpWK0QWiN\nFl88ojjbVGuh5viGkKsXNLlTzs9Fu0cB9OyZ+KkhRHfbXL7UzwDn611/EfdP\nnQBTyyie3B633IGotn8vOqZHmTFsL9mnvNMmEs9wmz6wzvN5uea3gof7l6Xf\nB2T3QgyvX1t+GbB5o8zwbXEHO65DZqIGvEeXrBgPSeqas/2Qcjz0f81MMYSI\nF6ADTlm6ixfhmHYgwpATPUjDqkQ36Mf+VrlhQVhpl4cA+XTNm7NpDmhr/A/C\nCXVYV5ctIExI20Wf/6bDCESlYsxDguqKoHUwnnXWn/oOwg4sYcbWFr8rLNHX\nZR5xl+PXcMJck8TkO+5cSsGU2r/Y6bAKQd9epD4tGI3JX4vz7k5AS4cazdIU\neuSkNLV+hCRXkw7YQzHH/OxhMOoMCfxGjmffzXqYdQI22ZAtAd0KvmemuvQu\ncPABZGCT/SFgcFKFbfeSi2yr3nN5MHnM3h4AhxG0MOYhPfpX62e3mM6durDQ\nWiMm\r\n=0ozy\r\n-----END PGP SIGNATURE-----\r\n" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "directories": {}, "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/mem_3.0.1_1529476682375_0.6427172635818768" }, "_hasShrinkwrap": false }, "4.0.0": { "name": "mem", "version": "4.0.0", "description": "Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/mem.git" }, "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=6" }, "scripts": { "test": "xo && ava" }, "files": [ "index.js" ], "keywords": [ "memoize", "function", "mem", "memoization", "cache", "caching", "optimize", "performance", "ttl", "expire", "promise" ], "dependencies": { "map-age-cleaner": "^0.1.1", "mimic-fn": "^1.0.0", "p-is-promise": "^1.1.0" }, "devDependencies": { "ava": "*", "delay": "^3.0.0", "xo": "*" }, "gitHead": "159369f78b3dc80b72c999e11ba1b350376cc3e4", "bugs": { "url": "https://github.com/sindresorhus/mem/issues" }, "homepage": "https://github.com/sindresorhus/mem#readme", "_id": "mem@4.0.0", "_npmVersion": "5.6.0", "_nodeVersion": "8.11.4", "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, "dist": { "integrity": "sha512-WQxG/5xYc3tMbYLXoXPm81ET2WDULiU5FxbuIoNbJqLOOI8zehXFdZuiUEgfdrU2mVB1pxBZUGlYORSrpuJreA==", "shasum": "6437690d9471678f6cc83659c00cbafcd6b0cdaf", "tarball": "https://registry.npmjs.org/mem/-/mem-4.0.0.tgz", "fileCount": 4, "unpackedSize": 6886, "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbhDXzCRA9TVsSAnZWagAAuogP/0BeGsvg/qP/EEHQAJxP\nPiIfi0gi6nP5qtX0dDqjKJALBYsFoRXJx9gFGr3MiyzQTGHulnSUBopmN/Um\nXBTeTw3jm97scLC71ozFIZRAUC9QFUs0j6RtRYNPghT6NgstB0sZZjMNASp5\nAepb4bOCNhb/j81EkMfNrGtFeOvq2/fzxnkwEbK581hWewCzLcH4E4our4Aq\nVfMvV/wTss9BNhAgM5GbhNOhr9ys1h2dThmjTkATlZE+lkULCAYYydA1spXM\nONTW+RjoCLjwjZ4xlSiPpy9y0AWhSSldXAqd7JByVHuRLCfw5mbBYJ96tgpy\nAP+nU41+SeiQRTV327Jjqie//D7s40CYqIlDXntUPsVNmO87qwNYxQ0HyYKP\n0+SN1Rhv4YhIUn0xtwHASUZR/O4q7cWD3VabeTA3wMGP2kbqV7XXVs9haqjj\n58XhT7euHZMetI6aUlkOPVP1gEG4yRy5E1HbtDfEC9fntIeH6WzyAvq6zrGT\nl4A/xBqT1wVdmbulnIx/32NnFNbZlmcse3dZv9R2vYp4Rn1fg0mXh7W4HRyu\nlS41J2yGxLdcUSfSFe//9kJn4kI9yQ7hBp00BVUTcXmZub2gUj45AazrVvRc\nKzs/a9Vxvu5JcDHTKO5H8LnNSclq3IEWLQXd8l4LvtzH7B7rtBdQUYJH2wn9\nxi+s\r\n=Fhi4\r\n-----END PGP SIGNATURE-----\r\n" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "directories": {}, "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/mem_4.0.0_1535391218283_0.18788295308356084" }, "_hasShrinkwrap": false }, "4.1.0": { "name": "mem", "version": "4.1.0", "description": "Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/mem.git" }, "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=6" }, "scripts": { "test": "xo && ava" }, "keywords": [ "memoize", "function", "mem", "memoization", "cache", "caching", "optimize", "performance", "ttl", "expire", "promise" ], "dependencies": { "map-age-cleaner": "^0.1.1", "mimic-fn": "^1.0.0", "p-is-promise": "^2.0.0" }, "devDependencies": { "ava": "^1.0.1", "delay": "^4.1.0", "xo": "^0.23.0" }, "gitHead": "a583160e36a088d565a82d11dfea3e78755cca18", "bugs": { "url": "https://github.com/sindresorhus/mem/issues" }, "homepage": "https://github.com/sindresorhus/mem#readme", "_id": "mem@4.1.0", "_npmVersion": "6.4.1", "_nodeVersion": "10.15.0", "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, "dist": { "integrity": "sha512-I5u6Q1x7wxO0kdOpYBB28xueHADYps5uty/zg936CiG8NTe5sJL8EjrCuLneuDW3PlMdZBGDIn8BirEVdovZvg==", "shasum": "aeb9be2d21f47e78af29e4ac5978e8afa2ca5b8a", "tarball": "https://registry.npmjs.org/mem/-/mem-4.1.0.tgz", "fileCount": 4, "unpackedSize": 7038, "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcUWQoCRA9TVsSAnZWagAA43sP/08xJjQxRmTXifguY+6t\nZ2aXdFgHJwTgNQ1B+iJoFGpmZqFLnn+5qEFCYJYRPMCowRtcvXFpn15tFc3k\nDrf3nulFUVNXJvWkqA4So8x15da/V2YMs999VLs50SyHmEJUReNWxENRLMij\nRSJlg6bufzS+lC+WPCBIpDi1KLSMJYc2NOgj1O9MVmKLL6GIXgfCnLNS0wFp\nXDeXWjFqJvv2I4rhaHevH+T7cpGZveZiVbYLDzUvnoPe9fmiKrDQCrz7Bvml\n0vHCILgXPcb353Jhvs2YPYununVpycoYDNIKdAvYGpssMAean/WJY4jLidq3\nuJUHlA5QzQmtR9QqNIZBKzMxhAe2RrbrTn7Xu8C7c7DVN/3WTCcfzbWXK3/+\nZt07aIX2lo8r8Fo/b21JEG0fby7cVd0LYotcddhCi7nEThGu81Vwi8Wqr8z9\nGWrQrNzn3jN7HV3t10wxCO64YtzXcM/Ak+RBuuGmfah0WcMI0okrYkda30uc\nlc0xipd90XoHB2NeA8c93NT4PpF6HlEJme+xSQgtX4RQDGYI6KyPoxo8dcTo\n5Lu+Vjnr9K18plLe31ePxfuotwldpGOGlTNCmVhOtz7wf5IqbSt19cHaxida\nNVbult6zzr1nWGfaS0RfwfI0YQIJ410DJilZJyMH6nmM0HcaeXuKj8+hqlPR\ndcGD\r\n=f+8V\r\n-----END PGP SIGNATURE-----\r\n" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "directories": {}, "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/mem_4.1.0_1548837927747_0.5551694125271442" }, "_hasShrinkwrap": false }, "4.2.0": { "name": "mem", "version": "4.2.0", "description": "Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/mem.git" }, "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=6" }, "scripts": { "test": "xo && ava && tsd-check" }, "keywords": [ "memoize", "function", "mem", "memoization", "cache", "caching", "optimize", "performance", "ttl", "expire", "promise" ], "dependencies": { "map-age-cleaner": "^0.1.1", "mimic-fn": "^2.0.0", "p-is-promise": "^2.0.0" }, "devDependencies": { "ava": "^1.3.1", "delay": "^4.1.0", "tsd-check": "^0.3.0", "xo": "^0.24.0" }, "gitHead": "6959d903627d24da2e31a9da686327daf86f2dda", "bugs": { "url": "https://github.com/sindresorhus/mem/issues" }, "homepage": "https://github.com/sindresorhus/mem#readme", "_id": "mem@4.2.0", "_nodeVersion": "8.15.0", "_npmVersion": "6.9.0", "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, "dist": { "integrity": "sha512-5fJxa68urlY0Ir8ijatKa3eRz5lwXnRCTvo9+TbTGAuTFJOwpGcY0X05moBd0nW45965Njt4CDI2GFQoG8DvqA==", "shasum": "5ee057680ed9cb8dad8a78d820f9a8897a102025", "tarball": "https://registry.npmjs.org/mem/-/mem-4.2.0.tgz", "fileCount": 5, "unpackedSize": 9439, "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJch+9bCRA9TVsSAnZWagAAZQwP/izKtmuKD3r2Kmojxv4a\nhbbncg0yv5WADMvbNTubLytnN5O/c1GKTa+0G2HKBz3rjwJ/4KX09bzgyBig\nVcjDkouItaLxtfOG6EpcvLo8iAzBO3YcqLclW4mDorGzE4ba0LipupjA45gr\n/rpfHfYEINoxCmsy2ALwQrD96UtwGpk1bf3BY5CNapzmUntG1BNhVMpdGzlS\nwsjdBpSagMd8jTWR6YwnyoqfZ5HpvJ2jsfDNXMM6fjAxUd1iC2vkdBFcvDch\npMr+YiU265XbyWz9j2QdJH75bb0Cbfa8Zm3lK9VM46mgqRL2sdNKYopUW3f7\nrKXgMBrub+rofpVRs8nsyhGcLywaD07i84J+f/HxT+65Z9BbkRo89axDeOA2\nLe0N3QuABlIy+KNZV0CqwSYSK2/YPaeJtM2IJztotOIs/VDpAADRfBlZ7zRG\nyezLarB124645gln+LI0KpgQi6HvscCtGWzRTRNWT4X3VZpa3Z7u1/Xp/yt1\nWN/7AoBMBx2OMiESL7VAsP/kSc3Nk5+O02pDCe3InDu2yu9DIDiC3SfVImK5\n2S5u5Yfjnp1vAuoHBZihXVIlJGBtJQNruEC91Z/9jljJrJfSzBZOXGbFT1HE\nX3WtmiBgBaNmBlvc7cJLpQIhbQeJnirBy+B63EZNywG2XX1XciD+nYeHadoq\noVhr\r\n=2Jn0\r\n-----END PGP SIGNATURE-----\r\n" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "directories": {}, "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/mem_4.2.0_1552412506855_0.4573656395957444" }, "_hasShrinkwrap": false }, "4.3.0": { "name": "mem", "version": "4.3.0", "description": "Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/mem.git" }, "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=6" }, "scripts": { "test": "xo && ava && tsd" }, "keywords": [ "memoize", "function", "mem", "memoization", "cache", "caching", "optimize", "performance", "ttl", "expire", "promise" ], "dependencies": { "map-age-cleaner": "^0.1.1", "mimic-fn": "^2.0.0", "p-is-promise": "^2.0.0" }, "devDependencies": { "ava": "^1.4.1", "delay": "^4.1.0", "tsd": "^0.7.1", "xo": "^0.24.0" }, "gitHead": "0e9275ea32d5e5343eeab31ceb0271f9f42c85b5", "bugs": { "url": "https://github.com/sindresorhus/mem/issues" }, "homepage": "https://github.com/sindresorhus/mem#readme", "_id": "mem@4.3.0", "_nodeVersion": "8.15.0", "_npmVersion": "6.9.0", "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, "dist": { "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", "shasum": "461af497bc4ae09608cdb2e60eefb69bff744178", "tarball": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", "fileCount": 5, "unpackedSize": 9746, "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcoRBQCRA9TVsSAnZWagAAibwP/05Hb2MoVvBJVTxbitFu\n64+CmL6LNZTanHNrNSPb6v7sXGFO+uvkjCC/Ebgk7lC9+H0rgUVODnpFSBqd\njXabw0R4FIqLc8Jf1hvZD02+kHwPBRGB9dHs6jP2gMw7WFTM0hArtCKAqEXg\nP21zLIw1yrNp8IatIZMAM/isJjl6MyGdBvDJKb5Zc9og8qiQ3bqHfzCLfBXf\nWCEylAtIT1TNYy20cROpsHBje4xKIWfQCQ1n9J+CqHt/VFiqb0OAGrIY1WCd\n9dh+L3eKdxTlcEejvb7myQCb4O5rCR3pZepJs1wTF5xJRz8RxT8fjvOvSH5O\nITpzt3NbSFDE2FkWPq5I4+Vd1S5I+A1w9kdbcFSnL5nTHVfLEWGZA0IAsdfc\nFMqAjINR9qdW+McQCjKTPUDgKg5OEUvcIhoTpIM47JuGTbUP/Px8DQhqC7Rb\njbjYWRs8d72I2edaNRhgnvJQsrm3f6N7kaPo2/q5gZfpfMPsn9sokrJkXPkA\n9axZaIQ2hpEqQNbctfQinlzIxx5dTjaDSoZ6rQbnHXYN+GjMrKqBanx5PcLg\nJg7Vz7Y29SckUVUUEE2P9/Qgdr+SgsNyN7ZBsSizjONqbwaoi0iAonw2Xp6T\nIf437lRzWSa9iqcvx+zlhkkBf1OU+AdE8nPwYu0Bz9M/bYPWj6Lg8umBRrHe\njaTN\r\n=55DC\r\n-----END PGP SIGNATURE-----\r\n" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "directories": {}, "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/mem_4.3.0_1554059343791_0.002943299052651671" }, "_hasShrinkwrap": false }, "5.0.0": { "name": "mem", "version": "5.0.0", "description": "Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/mem.git" }, "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=8" }, "scripts": { "test": "xo && ava && tsd" }, "keywords": [ "memoize", "function", "mem", "memoization", "cache", "caching", "optimize", "performance", "ttl", "expire", "promise" ], "dependencies": { "map-age-cleaner": "^0.1.3", "mimic-fn": "^2.1.0", "p-is-promise": "^2.1.0" }, "devDependencies": { "ava": "^1.4.1", "delay": "^4.1.0", "tsd": "^0.7.3", "xo": "^0.24.0" }, "gitHead": "05c983b2d96cd24747a310d80de7ae7ba92dc2db", "bugs": { "url": "https://github.com/sindresorhus/mem/issues" }, "homepage": "https://github.com/sindresorhus/mem#readme", "_id": "mem@5.0.0", "_nodeVersion": "8.16.0", "_npmVersion": "6.9.0", "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, "dist": { "integrity": "sha512-r0kKFSQy7ywj2AHxsCyRlIQqnqiazZBeOx6ZNVvfJtEEzqVMgvgp83tB30B9pcqfGDXXPHLuVgCXLwNE2Un6lQ==", "shasum": "c50f16afce423279080b174f0864d014c46a54e6", "tarball": "https://registry.npmjs.org/mem/-/mem-5.0.0.tgz", "fileCount": 5, "unpackedSize": 9679, "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc3u6OCRA9TVsSAnZWagAANxkP/0q5Gaqz00GnikC3Q906\n3zR5ROXRUy2bUUmXvPDn22zWkA+1TFdomdFtQIH1t/wUD/41CKxRTftHu0gL\nykEPgnRoR/Hcmo4p7pJz2Fn+sJOkahCxfCUy3kX+y6t9bsgoNlNiMCkwqRhy\nKVNeaph1aLIbS64FOpOKnB1gkJeLqpsh2X9caxKh+OEXhMNiV9c+8NMaa6x2\nq2oFiriGouV9PPLmUTkCyr1Y9BBD0PId77XyjkWG4S+eGh9Qw13VRtz284z9\nOowDnda8EQN4BxliLPOEy21EDAj/6HqB4VLF1s0AkNSY50sv3dcOrQztWlyH\nrTedA8Dg8Kbh0wcRjMPViqHFm1jgoBSl8O5fXE2G/tSCnEvreXdob8eOUYoK\n5zzjLf+lbLFt5sc1Z5xFsAyX0+qijEucSODfLVQk2Xj1cxvhpuuX0WBlTlGq\ngKQCWXA+ajsZY3/rY1ky1zlkxQq70RCunzg4yjTtVrDO2FvgOxpinR3Dybze\n0Y6+quP81RIHrm4FQtExo4/nO7NofgSYPS/6izyjPlpXV1+gURnSMxWcnXjy\nNjr6Es4NLtN/ZIcmGxA5wvWUEjUW8cPtct7A9BKExB8btVFZa0dJr5FsA1uZ\nid2dwexg4Px7jULup3H1EYqOhY2sNzAkX8/UiWDWcd5txJZ0OdPYWAKQo6fC\n8Pmd\r\n=GP2k\r\n-----END PGP SIGNATURE-----\r\n" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "directories": {}, "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/mem_5.0.0_1558113933912_0.8522334849958171" }, "_hasShrinkwrap": false }, "5.1.0": { "name": "mem", "version": "5.1.0", "description": "Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/mem.git" }, "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=8" }, "scripts": { "test": "xo && ava && tsd" }, "keywords": [ "memoize", "function", "mem", "memoization", "cache", "caching", "optimize", "performance", "ttl", "expire", "promise" ], "dependencies": { "map-age-cleaner": "^0.1.3", "mimic-fn": "^2.1.0", "p-is-promise": "^2.1.0" }, "devDependencies": { "ava": "^1.4.1", "delay": "^4.1.0", "tsd": "^0.7.3", "xo": "^0.24.0" }, "gitHead": "ce7f3b7135e32d80877dedf0f0b7bd3e14d0ad91", "bugs": { "url": "https://github.com/sindresorhus/mem/issues" }, "homepage": "https://github.com/sindresorhus/mem#readme", "_id": "mem@5.1.0", "_nodeVersion": "8.16.0", "_npmVersion": "6.9.0", "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, "dist": { "integrity": "sha512-9egM8rCo4wKiKuTwK1nFlSk39HbgluK93EgUmmboF85CVuKp7PoAwK3C8krkJeeFiH/ltExwVxcu+i2dKZYtDw==", "shasum": "b94ee9b888d26928dd9d91cab107fa04b925730b", "tarball": "https://registry.npmjs.org/mem/-/mem-5.1.0.tgz", "fileCount": 5, "unpackedSize": 9692, "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdBO8+CRA9TVsSAnZWagAAYMIP/AqXJioq5I4sVO2IxRoB\nMVQEq8bieSUTDz33I3/J/3qhv8yDAzs6AqpqPtk4uSHwB9ze3LHkV8kPsv6m\nnMFddbVGs8Df7vAaxkuH6XdXiZmnx3QCSqA/a5hjTwuPKsd0qYnTsId6NyVo\nbhXrL8mR0AUQ0+KihQiAu9cjXKFSh32QeKqRR7/wmZ5Y2q06a9OsSd8BMlzW\nIAD/0PqjfNkb1LWmeJk6uXd8/N6Mk4Sd8INY/QdE2JaQac/aTsu7FM5r8J+z\n5aqpvlXdj7HVWs+cxsCw5W/VMybpsEgb7cCS9TPFvkZ8A0+5dGaKhE+xGkoG\nhMqnKtSGtB9voaZhiQYO7m1P1h+OrUM9nKosvgGA6+yhP4k/dXGjBgwS/+Bc\nzuArX4LrWIyV7cCu2JyqYWJHf+VFpgVgoSHG4jKvE0lyZ9pqsGuqGNeWqj62\nLkhrB+4s06cWlNI7ozWldgYVFrbjM4TEcQm8DHD4CXtoo9SifnbsSWbI+nmA\nyEUVAxLov3uYSpaOgwEWRomnT7Gk27Hx2wDR3TxI8TRdAnDoi3DK93Jjln45\nwjBYRkx7BGBTAecH5S3PxI7XmB0Y1RnihNAtPu9KInjG+VNLTFqHihUB24FE\nsxpoI157vi99gkDJdxsiVDWN9JZ3gdz7+3tCIYsJz5j+R4FjLKAWf6QOeHz5\n/2IV\r\n=ozSS\r\n-----END PGP SIGNATURE-----\r\n" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "directories": {}, "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/mem_5.1.0_1560604477397_0.4599413287436944" }, "_hasShrinkwrap": false }, "5.1.1": { "name": "mem", "version": "5.1.1", "description": "Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/mem.git" }, "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=8" }, "scripts": { "test": "xo && ava && tsd" }, "keywords": [ "memoize", "function", "mem", "memoization", "cache", "caching", "optimize", "performance", "ttl", "expire", "promise" ], "dependencies": { "map-age-cleaner": "^0.1.3", "mimic-fn": "^2.1.0", "p-is-promise": "^2.1.0" }, "devDependencies": { "ava": "^1.4.1", "delay": "^4.1.0", "tsd": "^0.7.3", "xo": "^0.24.0" }, "gitHead": "0ca0b20e1c9a6280028414fac43d2901a5ae105e", "bugs": { "url": "https://github.com/sindresorhus/mem/issues" }, "homepage": "https://github.com/sindresorhus/mem#readme", "_id": "mem@5.1.1", "_nodeVersion": "10.16.0", "_npmVersion": "6.9.0", "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, "dist": { "integrity": "sha512-qvwipnozMohxLXG1pOqoLiZKNkC4r4qqRucSoDwXowsNGDSULiqFTRUF05vcZWnwJSG22qTsynQhxbaMtnX9gw==", "shasum": "7059b67bf9ac2c924c9f1cff7155a064394adfb3", "tarball": "https://registry.npmjs.org/mem/-/mem-5.1.1.tgz", "fileCount": 5, "unpackedSize": 9665, "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdF8SfCRA9TVsSAnZWagAAtAUP/3PwwNDle7+CZdJ0/wwN\nJYtvXOxIbiTGG3UTKhMwep2dFHfKzdSSHFkXD4zlHJxr2HVZw0cY1jqKq9Kc\n8wHm362NsRLUpjmVj+q3e+KQnoKWdVY6aRFa9NJGnjZCwRnsp8IlDXCdsy2D\nrr9KqZlUOakSLC4jHc7sPVRccPq/ots1guP40VQR8DcIO/9M7waRGkLt90jI\nAjXx3BXDuYUoRb17qJNL09H3MEnaHQmxawIGxTpH3MmzGuq4dBv9/gQOC3+i\ngmWwM2iS9iJ6Zw3OfpdXUvkEK7QdrS+6y3yjsxgskgxLIACeOHyBbWY8Y4zG\n9oyMYjA20+9ZqK0xnG/uaZI3fbCuWJIRS+BVDtWZmT1yx4xrxAcMGG1MmwYi\nemDD14DmfLFGKaR6+C+ckuwcWroD2uQfQB6G5G5Eckj0E76OnFSHL1qv/qMJ\ndovcPiTNRar5Xch0tCw06hl5tnKo0xA11vyEhR7QaD+2DvVEVtYyJU3YdGiu\nX/Q6pNTrwWRzblHr19stDaGT7FOBLKtBYa1RpRxPgz5LrJEhAUctRUgjE5zj\nQqdJ+Eo0kw7o2L6qYvrpP4XVDu6DkcrmNQ3qXXGkbSelXeqWsssxOjA5G8FT\np98u5QkFZLhZ6/sWVCF78LIsLpXJHMcl/mpgRhQdoEfUAjkro1GUgew2VRu0\nJubW\r\n=qZTg\r\n-----END PGP SIGNATURE-----\r\n" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "directories": {}, "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/mem_5.1.1_1561838751067_0.6864618207106226" }, "_hasShrinkwrap": false }, "6.0.0": { "name": "mem", "version": "6.0.0", "description": "Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/mem.git" }, "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=8" }, "scripts": { "test": "xo && ava && tsd" }, "keywords": [ "memoize", "function", "mem", "memoization", "cache", "caching", "optimize", "performance", "ttl", "expire", "promise" ], "dependencies": { "map-age-cleaner": "^0.1.3", "mimic-fn": "^3.0.0" }, "devDependencies": { "ava": "^2.4.0", "delay": "^4.1.0", "serialize-javascript": "^2.1.0", "tsd": "^0.10.0", "xo": "^0.25.3" }, "gitHead": "b154f53ad72ac76277c0cc2844febf1cd2df1795", "bugs": { "url": "https://github.com/sindresorhus/mem/issues" }, "homepage": "https://github.com/sindresorhus/mem#readme", "_id": "mem@6.0.0", "_nodeVersion": "12.13.0", "_npmVersion": "6.12.0", "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, "dist": { "integrity": "sha512-1zHBKMg0Xd4yw3EQju6cjJiNtPomak7aNkuJx19QihMco09icTTsLZtVvxfxBxQH/NNvjtA1skR9lDlvkdW46g==", "shasum": "f79bb110b90b688a2d1468566e66a911794abee5", "tarball": "https://registry.npmjs.org/mem/-/mem-6.0.0.tgz", "fileCount": 5, "unpackedSize": 10414, "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdySiRCRA9TVsSAnZWagAApMIQAIVALLVijqn6UMnu5XB9\nPGQBFSMU4FAAnnKCOj4lJT4whFHSFq1q3ZM3RbsrO0hklaZ7zmSBS7WenxsX\nc4W+GNlq/J04SpvgSw7/TEJdTWs85GqUDSuit8vtrLZvGdirJ6YN6MMdEF7a\nc79BEth2MdDcRgzmQtk0/1uQdbpbuhNfdpa8Gctcw0h9QeqcOj7tvUf6e3cw\nipTzMUwfhWt3p0ikfJLRTt6J+z8kZWGXZOzMNtWB2M8sxHm7Hnoj9+xKLLWd\nQt82tZcBbBh5cSKLCoEI78UqzzUQkbHN6GhxB2sOtAUEzYiJLpQDHWJ9NS+B\nCxEM+noUenh9sIBwMv4d7Wok+vWWIKSNUHnQ/7gObbvCD+0LFWir13k4K71v\n3+8eu8NKpQ0KEXE6/vpYj36i3wFVn3JIi03TFijoDvFyBVt9D23R8P3SVMOi\nhMR0niBp9IsMMwg+k1rhTSZdxbdrDK0aiivZmKLL6RvFj9/UxptUPHN5dvRN\nm7z1owYwhejspZLeV4X+U0H0xnV8I8Sx5pcXJdMyYI4zbpgTHqwogZGwHWHr\nRp5IeOZsxOHpC2AUvryww6Ohig19U+6ImRx6pq6uEKw2vpsd+xC9ecd67PT8\nwP1DYP1msfSupdIJoelMoDsdWlwFwG1yiEu0NXxjIRCd+SPfPiv8W9Wq2geS\noAR7\r\n=K9pr\r\n-----END PGP SIGNATURE-----\r\n" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], "directories": {}, "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/mem_6.0.0_1573464208617_0.15677627413666806" }, "_hasShrinkwrap": false }, "6.0.1": { "name": "mem", "version": "6.0.1", "description": "Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/mem.git" }, "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=8" }, "scripts": { "test": "xo && ava && tsd" }, "keywords": [ "memoize", "function", "mem", "memoization", "cache", "caching", "optimize", "performance", "ttl", "expire", "promise" ], "dependencies": { "map-age-cleaner": "^0.1.3", "mimic-fn": "^3.0.0" }, "devDependencies": { "ava": "^2.4.0", "delay": "^4.1.0", "serialize-javascript": "^2.1.0", "tsd": "^0.11.0", "xo": "^0.25.3" }, "gitHead": "9d5661e63642c250818306f37af8497eb61e2c11", "bugs": { "url": "https://github.com/sindresorhus/mem/issues" }, "homepage": "https://github.com/sindresorhus/mem#readme", "_id": "mem@6.0.1", "_nodeVersion": "13.2.0", "_npmVersion": "6.13.1", "dist": { "integrity": "sha512-uIRYASflIsXqvKe+7aXbLrydaRzz4qiK6amqZDQI++eRtW3UoKtnDcGeCAOREgll7YMxO5E4VB9+3B0LFmy96g==", "shasum": "3f8ad1b0f8c4e00daf07f104e95b9d78131d7908", "tarball": "https://registry.npmjs.org/mem/-/mem-6.0.1.tgz", "fileCount": 5, "unpackedSize": 10429, "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd4R1BCRA9TVsSAnZWagAAAAwP/RqVMRanVop8joy5Ixu5\nDfZFgJppajqPgFaaD2Q6hv9iyoQh6x7ua3625lmk5N2VmVIwz6FyYBbZ7tLv\ns6n0NOZj4f7j4uk8ri+Y5Tpzk1tdFEbf8IwTTiypSF79gQ5JI2wZLypw+R2g\n5Yrd/0ElvMj0cX4jPEnSLaV5zqw5Qx/zdPZYm9opf3gJ9e2JUB9z77Z7shjD\n9NlDwPrzAhUcCnUbt1hJWAQ0yu/EUQRi9z5Q8tLw3Bp9F8eP+ta6hdiHheIs\nvjEDqPa9MHMe/UyR9U5g1fjJ42OFsGFUYF/YLzh3ICnrokl/dJHuhXBMYDDK\nAbDnme6yRcPhFN+NoBSXGnTVOjc+J6W7KjEzMuU2C8lkGWmwj1DYVM1WLMX9\nrUQ1l68ZM3WcKOUWcB8YlUaoTU/7Wz9bJrtp+BMeNYZsu43lUaJDci4tA5zs\nrt0M4I6pZ78XySQC+hNtMHm+7A2tsAq4zUelcdPXSuGTtAGDnWU/hRddFcUo\nJRQ2pbb3XD8ovx1zvmqpsTFW5ZvP4k0mq32ms2Vg4lJbK3t8wgiePoSQGHqf\n7xLmvuVh9JAe2tPqTluE15BAto0BTf7Q8q4We0/W7NOjf6ZiT23MVK9dNWEr\nUMU6igz0gxlwFRjBhfCWjg5qs5QEBuWbMY0Hdc1U+m4yBuOUM0UP0HebJPsc\nSnQU\r\n=V5Wl\r\n-----END PGP SIGNATURE-----\r\n" }, "maintainers": [ { "email": "npm@bfred.it", "name": "bfred-it" }, { "email": "opensource@bfred.it", "name": "fregante" }, { "email": "sindresorhus@gmail.com", "name": "sindresorhus" } ], "_npmUser": { "name": "bfred-it", "email": "npm@bfred.it" }, "directories": {}, "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/mem_6.0.1_1575034176954_0.8670781925593525" }, "_hasShrinkwrap": false }, "6.1.0": { "name": "mem", "version": "6.1.0", "description": "Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/mem.git" }, "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=8" }, "scripts": { "test": "xo && ava && tsd" }, "keywords": [ "memoize", "function", "mem", "memoization", "cache", "caching", "optimize", "performance", "ttl", "expire", "promise" ], "dependencies": { "map-age-cleaner": "^0.1.3", "mimic-fn": "^3.0.0" }, "devDependencies": { "ava": "^2.4.0", "delay": "^4.1.0", "serialize-javascript": "^2.1.0", "tsd": "^0.11.0", "xo": "^0.25.3" }, "gitHead": "4646f004f3b6e528ae889e7c82e75bf6d02b9263", "bugs": { "url": "https://github.com/sindresorhus/mem/issues" }, "homepage": "https://github.com/sindresorhus/mem#readme", "_id": "mem@6.1.0", "_nodeVersion": "10.19.0", "_npmVersion": "6.13.4", "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, "dist": { "integrity": "sha512-RlbnLQgRHk5lwqTtpEkBTQ2ll/CG/iB+J4Hy2Wh97PjgZgXgWJWrFF+XXujh3UUVLvR4OOTgZzcWMMwnehlEUg==", "shasum": "846eca0bd4708a8f04b9c3f3cd769e194ae63c5c", "tarball": "https://registry.npmjs.org/mem/-/mem-6.1.0.tgz", "fileCount": 5, "unpackedSize": 13708, "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJekyRWCRA9TVsSAnZWagAA/gcP/ivDrGo5uH8KK6kHAjGe\ns22brv0UtikMmp2ydYBrhofB2gAE6u3bg7oP3Emd8peZ/Cdf+Fo4vc3BVgpB\n/Z0IVBZxTAY41qsrWiyYCf9Uylx+/DQTNx9jiywmzLJLuqA9ftQdfbRi+bDW\nQ4OZWisaueEADUjdB7tmgIiSRCUS/DaKxdPfuR2llYR5A2K7ZP493vXM2isn\nUULsclpmM2m5rB97iI3HeFsPQ09+Ml0PQJ2/YDRvoIQI//jN64Gnq6InSecV\n8RIy/l5Pv1aFHQ1MT4UzrkMIVqifcbDwsR0J8ehZD94V08AAnh3w5eDA3TOR\nyQcjmbtcIongI3NVZzLL509Lgej3VhXYcck4fRUNGcnoFlapKhFLK1MzmOzu\nYgerETqJpaCtPmOYMD3SXW5ikjHxwR7ZSKLBt7EViSbX8uLSIsodW68YJ/lR\nsk0TSfr0aqEFYvd1LluPffH1j6ckxCswwYJUBiZzQX/11IkwKbtKi80Zd6sn\n2VvGiBjNdLB7yJjOInNtX1Tg2x07W8J+fEKZTq1uEY/v/DgXfUYCzqxqACWM\n/KCft58T1XzXeyKVu+Aw8dFKhDe8lEGCZk7jsiZgGiqt0OF/qtT6NVQNk09d\nBhsmNbFg+hof9ywYYw9TGQNV9o9Qgwu8PaBR6v2cxnvTnzHNbL3EpNnylUeL\nAwel\r\n=t8OY\r\n-----END PGP SIGNATURE-----\r\n" }, "maintainers": [ { "email": "npm@bfred.it", "name": "bfred-it" }, { "email": "opensource@bfred.it", "name": "fregante" }, { "email": "sindresorhus@gmail.com", "name": "sindresorhus" } ], "directories": {}, "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/mem_6.1.0_1586701398069_0.07114174247388583" }, "_hasShrinkwrap": false }, "6.1.1": { "name": "mem", "version": "6.1.1", "description": "Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/mem.git" }, "funding": "https://github.com/sindresorhus/mem?sponsor=1", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "https://sindresorhus.com" }, "engines": { "node": ">=8" }, "scripts": { "test": "xo && ava && tsd" }, "keywords": [ "memoize", "function", "mem", "memoization", "cache", "caching", "optimize", "performance", "ttl", "expire", "promise" ], "dependencies": { "map-age-cleaner": "^0.1.3", "mimic-fn": "^3.0.0" }, "devDependencies": { "ava": "^2.4.0", "delay": "^4.1.0", "serialize-javascript": "^2.1.0", "tsd": "^0.11.0", "xo": "^0.25.3" }, "gitHead": "807d7c0ef27c9d76fe682103ea39e6763abcf051", "bugs": { "url": "https://github.com/sindresorhus/mem/issues" }, "homepage": "https://github.com/sindresorhus/mem#readme", "_id": "mem@6.1.1", "_nodeVersion": "10.22.0", "_npmVersion": "6.14.7", "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, "dist": { "integrity": "sha512-Ci6bIfq/UgcxPTYa8dQQ5FY3BzKkT894bwXWXxC/zqs0XgMO2cT20CGkOqda7gZNkmK5VP4x89IGZ6K7hfbn3Q==", "shasum": "ea110c2ebc079eca3022e6b08c85a795e77f6318", "tarball": "https://registry.npmjs.org/mem/-/mem-6.1.1.tgz", "fileCount": 5, "unpackedSize": 13465, "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSs7sCRA9TVsSAnZWagAAZK0P/3AojGIRtoW/HY2kLu0g\n2I8IZjgy7wdYMdN3AdhjqntALhmtZUL8grm91hPAzJ+M05tBvgf7WBldwHkR\nnnnLQpTW+77OQ8inHG4uWvJssDAftJnsNRubQUX59UYZ0rv7hGXTR3xRZpdk\nPrEbSq71UD6SJzSSLQeo1HMd6WUWTEQr6LlEgtnQUzuHg03vLk5pVBCm+umF\nqlVjdmM+I7XOH33eiWLszzaj1z1Aq81LxvWA/+RK9Nnjx6XdaSGv4Hh0QQjc\nBk2w7JSqkwIXpI3baJXvURmsopHmFAJdGZuhbJiX6qW2dEtjeII/0h45Mv/j\nP4rYVD5VzSdZs/1t2witt0EtrsG6MHv6Aao12Y79c0k5Mwwre63JdpiIsXU/\nA5A8zA1AHDdjQglL5Pes2fxqCgtglqsqbWoiUWbg9NuOb1PxDckiXjY6gA4k\ni7jkFk15zElx4R+sIh0oc3rJuSQzIPes8jZ4XSrLAu+cuzwSaHqBuK+Dy22X\nEQkROCQ/z2yPmJrpMEoh/O8YI0bUc3qP8bvMveiUIols9MlRiYhGnbzQDRX/\nDdz9mz56LgAw5w7e+u6jx1oAGwS8ym07j+S7lmwkLY9ITHHLjiakrCXTgtAi\nU04l7a3VvpyTtYon98vxmYp5Nj+z1S7JT2wNNMXxODY6MxglZ3lyAXCNC/ZP\nkM9k\r\n=fB+m\r\n-----END PGP SIGNATURE-----\r\n" }, "maintainers": [ { "email": "opensource@bfred.it", "name": "fregante" }, { "email": "sindresorhus@gmail.com", "name": "sindresorhus" } ], "directories": {}, "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/mem_6.1.1_1598738155686_0.25783327221446584" }, "_hasShrinkwrap": false }, "7.0.0-0": { "name": "mem", "version": "7.0.0-0", "description": "Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/mem.git" }, "funding": "https://github.com/sindresorhus/mem?sponsor=1", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "https://sindresorhus.com" }, "engines": { "node": ">=8" }, "scripts": { "test": "xo && npm run build && ava", "build": "del-cli dist && tsc", "prepack": "npm run build" }, "main": "dist", "keywords": [ "memoize", "function", "mem", "memoization", "cache", "caching", "optimize", "performance", "ttl", "expire", "promise" ], "dependencies": { "map-age-cleaner": "^0.1.3", "mimic-fn": "^3.0.0" }, "devDependencies": { "@ava/typescript": "^1.1.1", "@sindresorhus/tsconfig": "^0.7.0", "ava": "^2.4.0", "del-cli": "^3.0.1", "delay": "^4.1.0", "serialize-javascript": "^2.1.0", "typescript": "^4.0.3", "xo": "^0.25.3" }, "readme": "# mem [![Build Status](https://travis-ci.org/sindresorhus/mem.svg?branch=master)](https://travis-ci.org/sindresorhus/mem)\n\n> [Memoize](https://en.wikipedia.org/wiki/Memoization) functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input\n\nMemory is automatically released when an item expires or the cache is cleared.\n\nBy default, **only the first argument is considered** and it only works with [primitives](https://developer.mozilla.org/en-US/docs/Glossary/Primitive). If you need to cache multiple arguments or cache `object`s *by value*, have a look at alternative [caching strategies](#caching-strategy) below.\n\n## Install\n\n```\n$ npm install mem\n```\n\n## Usage\n\n```js\nconst mem = require('mem');\n\nlet i = 0;\nconst counter = () => ++i;\nconst memoized = mem(counter);\n\nmemoized('foo');\n//=> 1\n\n// Cached as it's the same argument\nmemoized('foo');\n//=> 1\n\n// Not cached anymore as the argument changed\nmemoized('bar');\n//=> 2\n\nmemoized('bar');\n//=> 2\n\n// Only the first argument is considered by default\nmemoized('bar', 'foo');\n//=> 2\n```\n\n##### Works fine with promise returning functions\n\n```js\nconst mem = require('mem');\n\nlet i = 0;\nconst counter = async () => ++i;\nconst memoized = mem(counter);\n\n(async () => {\n\tconsole.log(await memoized());\n\t//=> 1\n\n\t// The return value didn't increase as it's cached\n\tconsole.log(await memoized());\n\t//=> 1\n})();\n```\n\n```js\nconst mem = require('mem');\nconst got = require('got');\nconst delay = require('delay');\n\nconst memGot = mem(got, {maxAge: 1000});\n\n(async () => {\n\tawait memGot('https://sindresorhus.com');\n\n\t// This call is cached\n\tawait memGot('https://sindresorhus.com');\n\n\tawait delay(2000);\n\n\t// This call is not cached as the cache has expired\n\tawait memGot('https://sindresorhus.com');\n})();\n```\n\n### Caching strategy\n\nBy default, only the first argument is compared via exact equality (`===`) to determine whether a call is identical.\n\n```js\nconst power = mem((a, b) => Math.power(a, b));\n\npower(2, 2); // => 4, stored in cache with the key 2 (number)\npower(2, 3); // => 4, retrieved from cache at key 2 (number), it's wrong\n```\n\nYou will have to use the `cache` and `cacheKey` options appropriate to your function. In this specific case, the following could work:\n\n```js\nconst power = mem((a, b) => Math.power(a, b), {\n cacheKey: arguments_ => arguments_.join(',')\n});\n\npower(2, 2); // => 4, stored in cache with the key '2,2' (both arguments as one string)\npower(2, 3); // => 8, stored in cache with the key '2,3'\n```\n\nMore advanced examples follow.\n\n#### Example: Options-like argument\n\nIf your function accepts an object, it won't be memoized out of the box:\n\n```js\nconst heavyMemoizedOperation = mem(heavyOperation);\n\nheavyMemoizedOperation({full: true}); // Stored in cache with the object as key\nheavyMemoizedOperation({full: true}); // Stored in cache with the object as key, again\n// The objects look the same but for JS they're two different objects\n```\n\nYou might want to serialize or hash them, for example using `JSON.stringify` or something like [serialize-javascript](https://github.com/yahoo/serialize-javascript), which can also serialize `RegExp`, `Date` and so on.\n\n```js\nconst heavyMemoizedOperation = mem(heavyOperation, {cacheKey: JSON.stringify});\n\nheavyMemoizedOperation({full: true}); // Stored in cache with the key '[{\"full\":true}]' (string)\nheavyMemoizedOperation({full: true}); // Retrieved from cache\n```\n\nThe same solution also works if it accepts multiple serializable objects:\n\n```js\nconst heavyMemoizedOperation = mem(heavyOperation, {cacheKey: JSON.stringify});\n\nheavyMemoizedOperation('hello', {full: true}); // Stored in cache with the key '[\"hello\",{\"full\":true}]' (string)\nheavyMemoizedOperation('hello', {full: true}); // Retrieved from cache\n```\n\n#### Example: Multiple non-serializable arguments\n\nIf your function accepts multiple arguments that aren't supported by `JSON.stringify` (e.g. DOM elements and functions), you can instead extend the initial exact equality (`===`) to work on multiple arguments using [`many-keys-map`](https://github.com/fregante/many-keys-map):\n\n```js\nconst ManyKeysMap = require('many-keys-map');\n\nconst addListener = (emitter, eventName, listener) => emitter.on(eventName, listener);\n\nconst addOneListener = mem(addListener, {\n\tcacheKey: arguments_ => arguments_, // Use *all* the arguments as key\n\tcache: new ManyKeysMap() // Correctly handles all the arguments for exact equality\n});\n\naddOneListener(header, 'click', console.log); // `addListener` is run, and it's cached with the `arguments` array as key\naddOneListener(header, 'click', console.log); // `addListener` is not run again\naddOneListener(mainContent, 'load', console.log); // `addListener` is run, and it's cached with the `arguments` array as key\n```\n\nBetter yet, if your function’s arguments are compatible with `WeakMap`, you should use [`deep-weak-map`](https://github.com/futpib/deep-weak-map) instead of `many-keys-map`. This will help avoid memory leaks.\n\n## API\n\n### mem(fn, options?)\n\n#### fn\n\nType: `Function`\n\nFunction to be memoized.\n\n#### options\n\nType: `object`\n\n##### maxAge\n\nType: `number`\\\nDefault: `Infinity`\n\nMilliseconds until the cache expires.\n\n##### cacheKey\n\nType: `Function`\\\nDefault: `arguments_ => arguments_[0]`\\\nExample: `arguments_ => JSON.stringify(arguments_)`\n\nDetermines the cache key for storing the result based on the function arguments. By default, **only the first argument is considered**.\n\nA `cacheKey` function can return any type supported by `Map` (or whatever structure you use in the `cache` option).\n\nRefer to the [caching strategies](#caching-strategy) section for more information.\n\n##### cache\n\nType: `object`\\\nDefault: `new Map()`\n\nUse a different cache storage. Must implement the following methods: `.has(key)`, `.get(key)`, `.set(key, value)`, `.delete(key)`, and optionally `.clear()`. You could for example use a `WeakMap` instead or [`quick-lru`](https://github.com/sindresorhus/quick-lru) for a LRU cache.\n\nRefer to the [caching strategies](#caching-strategy) section for more information.\n\n### mem.clear(fn)\n\nClear all cached data of a memoized function.\n\n#### fn\n\nType: `Function`\n\nMemoized function.\n\n## Tips\n\n### Cache statistics\n\nIf you want to know how many times your cache had a hit or a miss, you can make use of [stats-map](https://github.com/SamVerschueren/stats-map) as a replacement for the default cache.\n\n#### Example\n\n```js\nconst mem = require('mem');\nconst StatsMap = require('stats-map');\nconst got = require('got');\n\nconst cache = new StatsMap();\nconst memGot = mem(got, {cache});\n\n(async () => {\n\tawait memGot('https://sindresorhus.com');\n\tawait memGot('https://sindresorhus.com');\n\tawait memGot('https://sindresorhus.com');\n\n\tconsole.log(cache.stats);\n\t//=> {hits: 2, misses: 1}\n})();\n```\n\n## Related\n\n- [p-memoize](https://github.com/sindresorhus/p-memoize) - Memoize promise-returning & async functions\n\n---\n\n
\n\t\n\t\tGet professional support for this package with a Tidelift subscription\n\t\n\t
\n\t\n\t\tTidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.\n\t
\n
\n", "readmeFilename": "readme.md", "gitHead": "c7278273a12dc52f0d31fa32618e1c0c53e5f75a", "bugs": { "url": "https://github.com/sindresorhus/mem/issues" }, "homepage": "https://github.com/sindresorhus/mem#readme", "_id": "mem@7.0.0-0", "_nodeVersion": "14.4.0", "_npmVersion": "6.14.5", "dist": { "integrity": "sha512-zmKeaTcfG6grdWzOPBW0Vy73/sOmyoT6lGc07uVZ9Cjn1t6XYZ9E1ieXbI5+3zZ2kX5MujBkaDJA5C6W791e9w==", "shasum": "9c201deb5666116ce445083142152f2f7104d189", "tarball": "https://registry.npmjs.org/mem/-/mem-7.0.0-0.tgz", "fileCount": 5, "unpackedSize": 14501, "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdT0mCRA9TVsSAnZWagAADrsP/13H2oo1gercgFuBkevB\nelZxcG2W8CagAsC2cOv/lgB+j4BC64ibivhew/klgvZkm5wd+IA9w8Edo7ly\npT+T8RDNNvGZmUaK7mgn9CxOgP5+dzKUMU09mfWBOvH7+ZZp3EDGAM3KmfXY\nhw1DwoWRQOhvHVLqU+EQ9wE6phohr4TgyK630Xp4BG8lbenYJIyapRZYob0N\nXwYQiASytVToetGHmjA1a2B60SK2+ccPTEgtbAX48zpsJ6rmNeVZaIHPxslb\ncSxwzwaOr7EGW3xPdffyYs5ewOqljdclWOOKeyjA/BaAdBvHtZYzOi13nb53\nycBsMr3KRGt1gtAj4xENelsy7yzpul43CoH6v1dvLEAxmqLg+Eyf0Z64OhcX\nOQ5HSWIvKpm9sR83GrUZ15XiHE9kYLqYhDPbyHZHSVMDFwQZMWpZDC++lUCI\nAAjcDXe73+7/B43JOucZvcX7kpepfe3O23VzszegUxiFxlpCb73xyfSOYrRb\ntwuFuzOzBEhGKkDGzf7Hn6fxmm2Wimd4aJJlA+mWRuX26SIdOJLGN301rJTc\nZX5t1HtwnL8b8WjQZGVSDX8Cd/oiveVnMOiSQCex5lEjByAesn0F8JUm7N8P\n37nNEObSnaAgc9WTbAhzcDSM+tdsA7OAEKf+NxZoWBv8CT9Nwvvgf4eU/3By\ng0Fd\r\n=Wr2S\r\n-----END PGP SIGNATURE-----\r\n" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, { "name": "fregante", "email": "opensource@bfred.it" } ], "_npmUser": { "name": "fregante", "email": "opensource@bfred.it" }, "directories": {}, "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/mem_7.0.0-0_1601518885488_0.6127079045959467" }, "_hasShrinkwrap": false }, "7.0.0-1": { "name": "mem", "version": "7.0.0-1", "description": "Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/mem.git" }, "funding": "https://github.com/sindresorhus/mem?sponsor=1", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "https://sindresorhus.com" }, "engines": { "node": ">=8" }, "scripts": { "test": "xo && npm run build && ava", "build": "del-cli dist && tsc", "prepack": "npm run build" }, "main": "dist", "keywords": [ "memoize", "function", "mem", "memoization", "cache", "caching", "optimize", "performance", "ttl", "expire", "promise" ], "dependencies": { "map-age-cleaner": "^0.1.3", "mimic-fn": "^3.0.0" }, "devDependencies": { "@ava/typescript": "^1.1.1", "@sindresorhus/tsconfig": "^0.7.0", "ava": "^2.4.0", "del-cli": "^3.0.1", "delay": "^4.1.0", "serialize-javascript": "^2.1.0", "typescript": "^4.0.3", "xo": "^0.25.3" }, "gitHead": "28a9618f00ec98162d26e5616595831c71a3472c", "bugs": { "url": "https://github.com/sindresorhus/mem/issues" }, "homepage": "https://github.com/sindresorhus/mem#readme", "_id": "mem@7.0.0-1", "_nodeVersion": "14.4.0", "_npmVersion": "6.14.5", "dist": { "integrity": "sha512-uZ27qn08m7TqY2eqjWuT/mhAPbZh384vsXEqNBLvn/4moZNPkZMaMoo06nawla+Nkk+JSMGUTgp9Hmn6QLe7Qg==", "shasum": "0a98d4c7f9f06bcb8b325fe50a14174255ec6f8d", "tarball": "https://registry.npmjs.org/mem/-/mem-7.0.0-1.tgz", "fileCount": 5, "unpackedSize": 14553, "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdUN6CRA9TVsSAnZWagAAcn0P/2f7O60bD8oX9ougzo+s\ne5nXfdqS5jEdZ7VtLYn3J/XE7cr/KBL/2eKLNKXrnON4Vx/QZAYzAUcZT3Oe\nkmPRQtoArF2p3+IQkjLzc9ZsIuJYejtb7l05Kqm+lz7CxScTbEMgvAKcws1K\nABpLuaFwkCxhaYItLTJMuIiejNa4GyNNdO+dJ83WPC0DocHDs3jd3fo6UPYe\na14UWbnsZQWIV1GCs5wsGKQchhM7d25ZKCSDDB9HHjWbMq1ghXynsedZ2Fy5\nlKm0XNtYhCBH0wChYbD1yf5St+UXfZc7zzXaxNKgpp3SEeasAxg8C3VVVjMV\n0B5MNJ29FAGFlcZDS7L7+gXPuY0qb6GKMD4/29RpIQgI1PqFUUw1ipBQDma1\n3x4xyPT2DMACvc9VyFSxONhsGxXqNUSPML3lxcsHWEQQBAfFWh/M86ZWyNE1\nuwv6pJLrNclrZz8/Zm+xp4Qd47sFq6SG8ljPJLyJpCYpTnHAo9hMuNFeq8J5\nlbaUSwEQOG6nqpc5qGVBvE9NDMzNdx1ZFQd9UOy7Mg3zL4fg3TU2C2rNlFx+\n3SMMpYGYjNF2V2adikq3Bfsoq6YOHJ2rb21weIqm6qs1sJp5icFB/c045LGw\nGp6DJ2v9r9DyAa9LrCO1meMKQ9pd5Xy1zfRG8qAHxpAkjTO84kQiv038ChOJ\naqFN\r\n=F1tS\r\n-----END PGP SIGNATURE-----\r\n" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, { "name": "fregante", "email": "opensource@bfred.it" } ], "_npmUser": { "name": "fregante", "email": "opensource@bfred.it" }, "directories": {}, "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/mem_7.0.0-1_1601520505592_0.17666955862077294" }, "_hasShrinkwrap": false }, "7.0.0-2": { "name": "mem", "version": "7.0.0-2", "description": "Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/mem.git" }, "funding": "https://github.com/sindresorhus/mem?sponsor=1", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "https://sindresorhus.com" }, "engines": { "node": ">=10" }, "scripts": { "test": "xo && npm run build && ava", "build": "del-cli dist && tsc", "prepack": "npm run build" }, "main": "dist", "keywords": [ "memoize", "function", "mem", "memoization", "cache", "caching", "optimize", "performance", "ttl", "expire", "promise" ], "dependencies": { "map-age-cleaner": "^0.1.3", "mimic-fn": "^3.0.0" }, "devDependencies": { "@ava/typescript": "^1.1.1", "@sindresorhus/tsconfig": "^0.7.0", "@types/serialize-javascript": "^4.0.0", "ava": "^3.13.0", "del-cli": "^3.0.1", "delay": "^4.1.0", "serialize-javascript": "^5.0.1", "typescript": "^4.0.3", "xo": "^0.33.1" }, "ava": { "files": [ "test.ts" ], "timeout": "1m", "typescript": { "rewritePaths": { "./": "dist/" } } }, "xo": { "rules": { "@typescript-eslint/no-var-requires": "off", "@typescript-eslint/no-empty-function": "off" } }, "readme": "# mem [![Build Status](https://travis-ci.org/sindresorhus/mem.svg?branch=master)](https://travis-ci.org/sindresorhus/mem)\n\n> [Memoize](https://en.wikipedia.org/wiki/Memoization) functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input\n\nMemory is automatically released when an item expires or the cache is cleared.\n\nBy default, **only the first argument is considered** and it only works with [primitives](https://developer.mozilla.org/en-US/docs/Glossary/Primitive). If you need to cache multiple arguments or cache `object`s *by value*, have a look at alternative [caching strategies](#caching-strategy) below.\n\n## Install\n\n```\n$ npm install mem\n```\n\n## Usage\n\n```js\nconst mem = require('mem');\n\nlet i = 0;\nconst counter = () => ++i;\nconst memoized = mem(counter);\n\nmemoized('foo');\n//=> 1\n\n// Cached as it's the same argument\nmemoized('foo');\n//=> 1\n\n// Not cached anymore as the argument changed\nmemoized('bar');\n//=> 2\n\nmemoized('bar');\n//=> 2\n\n// Only the first argument is considered by default\nmemoized('bar', 'foo');\n//=> 2\n```\n\n##### Works fine with promise returning functions\n\n```js\nconst mem = require('mem');\n\nlet i = 0;\nconst counter = async () => ++i;\nconst memoized = mem(counter);\n\n(async () => {\n\tconsole.log(await memoized());\n\t//=> 1\n\n\t// The return value didn't increase as it's cached\n\tconsole.log(await memoized());\n\t//=> 1\n})();\n```\n\n```js\nconst mem = require('mem');\nconst got = require('got');\nconst delay = require('delay');\n\nconst memGot = mem(got, {maxAge: 1000});\n\n(async () => {\n\tawait memGot('https://sindresorhus.com');\n\n\t// This call is cached\n\tawait memGot('https://sindresorhus.com');\n\n\tawait delay(2000);\n\n\t// This call is not cached as the cache has expired\n\tawait memGot('https://sindresorhus.com');\n})();\n```\n\n### Caching strategy\n\nBy default, only the first argument is compared via exact equality (`===`) to determine whether a call is identical.\n\n```js\nconst power = mem((a, b) => Math.power(a, b));\n\npower(2, 2); // => 4, stored in cache with the key 2 (number)\npower(2, 3); // => 4, retrieved from cache at key 2 (number), it's wrong\n```\n\nYou will have to use the `cache` and `cacheKey` options appropriate to your function. In this specific case, the following could work:\n\n```js\nconst power = mem((a, b) => Math.power(a, b), {\n cacheKey: arguments_ => arguments_.join(',')\n});\n\npower(2, 2); // => 4, stored in cache with the key '2,2' (both arguments as one string)\npower(2, 3); // => 8, stored in cache with the key '2,3'\n```\n\nMore advanced examples follow.\n\n#### Example: Options-like argument\n\nIf your function accepts an object, it won't be memoized out of the box:\n\n```js\nconst heavyMemoizedOperation = mem(heavyOperation);\n\nheavyMemoizedOperation({full: true}); // Stored in cache with the object as key\nheavyMemoizedOperation({full: true}); // Stored in cache with the object as key, again\n// The objects look the same but for JS they're two different objects\n```\n\nYou might want to serialize or hash them, for example using `JSON.stringify` or something like [serialize-javascript](https://github.com/yahoo/serialize-javascript), which can also serialize `RegExp`, `Date` and so on.\n\n```js\nconst heavyMemoizedOperation = mem(heavyOperation, {cacheKey: JSON.stringify});\n\nheavyMemoizedOperation({full: true}); // Stored in cache with the key '[{\"full\":true}]' (string)\nheavyMemoizedOperation({full: true}); // Retrieved from cache\n```\n\nThe same solution also works if it accepts multiple serializable objects:\n\n```js\nconst heavyMemoizedOperation = mem(heavyOperation, {cacheKey: JSON.stringify});\n\nheavyMemoizedOperation('hello', {full: true}); // Stored in cache with the key '[\"hello\",{\"full\":true}]' (string)\nheavyMemoizedOperation('hello', {full: true}); // Retrieved from cache\n```\n\n#### Example: Multiple non-serializable arguments\n\nIf your function accepts multiple arguments that aren't supported by `JSON.stringify` (e.g. DOM elements and functions), you can instead extend the initial exact equality (`===`) to work on multiple arguments using [`many-keys-map`](https://github.com/fregante/many-keys-map):\n\n```js\nconst ManyKeysMap = require('many-keys-map');\n\nconst addListener = (emitter, eventName, listener) => emitter.on(eventName, listener);\n\nconst addOneListener = mem(addListener, {\n\tcacheKey: arguments_ => arguments_, // Use *all* the arguments as key\n\tcache: new ManyKeysMap() // Correctly handles all the arguments for exact equality\n});\n\naddOneListener(header, 'click', console.log); // `addListener` is run, and it's cached with the `arguments` array as key\naddOneListener(header, 'click', console.log); // `addListener` is not run again\naddOneListener(mainContent, 'load', console.log); // `addListener` is run, and it's cached with the `arguments` array as key\n```\n\nBetter yet, if your function’s arguments are compatible with `WeakMap`, you should use [`deep-weak-map`](https://github.com/futpib/deep-weak-map) instead of `many-keys-map`. This will help avoid memory leaks.\n\n## API\n\n### mem(fn, options?)\n\n#### fn\n\nType: `Function`\n\nFunction to be memoized.\n\n#### options\n\nType: `object`\n\n##### maxAge\n\nType: `number`\\\nDefault: `Infinity`\n\nMilliseconds until the cache expires.\n\n##### cacheKey\n\nType: `Function`\\\nDefault: `arguments_ => arguments_[0]`\\\nExample: `arguments_ => JSON.stringify(arguments_)`\n\nDetermines the cache key for storing the result based on the function arguments. By default, **only the first argument is considered**.\n\nA `cacheKey` function can return any type supported by `Map` (or whatever structure you use in the `cache` option).\n\nRefer to the [caching strategies](#caching-strategy) section for more information.\n\n##### cache\n\nType: `object`\\\nDefault: `new Map()`\n\nUse a different cache storage. Must implement the following methods: `.has(key)`, `.get(key)`, `.set(key, value)`, `.delete(key)`, and optionally `.clear()`. You could for example use a `WeakMap` instead or [`quick-lru`](https://github.com/sindresorhus/quick-lru) for a LRU cache.\n\nRefer to the [caching strategies](#caching-strategy) section for more information.\n\n### mem.clear(fn)\n\nClear all cached data of a memoized function.\n\n#### fn\n\nType: `Function`\n\nMemoized function.\n\n## Tips\n\n### Cache statistics\n\nIf you want to know how many times your cache had a hit or a miss, you can make use of [stats-map](https://github.com/SamVerschueren/stats-map) as a replacement for the default cache.\n\n#### Example\n\n```js\nconst mem = require('mem');\nconst StatsMap = require('stats-map');\nconst got = require('got');\n\nconst cache = new StatsMap();\nconst memGot = mem(got, {cache});\n\n(async () => {\n\tawait memGot('https://sindresorhus.com');\n\tawait memGot('https://sindresorhus.com');\n\tawait memGot('https://sindresorhus.com');\n\n\tconsole.log(cache.stats);\n\t//=> {hits: 2, misses: 1}\n})();\n```\n\n## Related\n\n- [p-memoize](https://github.com/sindresorhus/p-memoize) - Memoize promise-returning & async functions\n\n---\n\n
\n\t\n\t\tGet professional support for this package with a Tidelift subscription\n\t\n\t
\n\t\n\t\tTidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.\n\t
\n
\n", "readmeFilename": "readme.md", "gitHead": "be5f6db8401486b597b280e40d18910690f6c737", "bugs": { "url": "https://github.com/sindresorhus/mem/issues" }, "homepage": "https://github.com/sindresorhus/mem#readme", "_id": "mem@7.0.0-2", "_nodeVersion": "14.4.0", "_npmVersion": "6.14.5", "dist": { "integrity": "sha512-Y5cusA/lEuuAC+a4JRsPsPDvCjqf1r3tdkGH7IZzSEsAoZb7vZod/xJQr2Cpybaud6QATYG+1ULce1hfu3iWMg==", "shasum": "f88933ed3b7843ba1a8a89ac99c2910223711bfb", "tarball": "https://registry.npmjs.org/mem/-/mem-7.0.0-2.tgz", "fileCount": 5, "unpackedSize": 14846, "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdZw2CRA9TVsSAnZWagAAZv8P/2sMEi7zX3fIyWCohQ7h\n+Q6CVyEWMY/JVMXf59RLrdz/YW5GbrJFlCbJoO2OcIJmgjl+QQvNd/59xgxh\nwn5ttEub9E9cdQB0WE1ekmnKHxvX5JU2MAid7bWE7ZyAsVm/x1MfytOTjKuH\nKJ6Vmocln1mG7pSnRmsOV6/tY9R7+N0FgtEz/fxKguQmDHdQP7lS2jvUxdyf\nFzM86OZ8yVw4g6ktDAEruw7LyGBcYjbEeCY5rfosFU06SCEBxaFH6SJv/v/G\nMxZpJ8bTQclrAOlkyKgqe7Iir5Q9nQ0MgTwvQ9NiyjyN5pruCZCkz1ImQ3K8\nLIjkKReKMmTl8PDzGXPNXo7EY0ado4Ts3x/9HAcYEMvdM+3+bKEg67ClSgHs\n/BheWi34AHlGI5WHt13kRzp0RlCqJPXDPBzo1reVj/xYe9hoxt1Qu3nWsAh3\nQy3SUybKkqJBA1mbl+yPxtieWp3mlM07ty+njpPWkX4H6VGrmVk8Ri8TkMe8\nC07O+NVZsesLj03ITa1HVZH15r39Nk4JwK+BRRUS5MJkCnQyFwtcaqFNNKqR\n3eRwwlYsjzJ0ulrlhprqSZd/cVAY96a3T9cCwNMH3VjFYleX5wsSX5kxEBmc\neUYOKFBrOsKJ5kkAJFGh+8IJyxS5gYL3h+LYnmL3b2aCyxlX7RgDmrj01CKI\nuwEL\r\n=l7Nf\r\n-----END PGP SIGNATURE-----\r\n" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, { "name": "fregante", "email": "opensource@bfred.it" } ], "_npmUser": { "name": "fregante", "email": "opensource@bfred.it" }, "directories": {}, "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/mem_7.0.0-2_1601543222172_0.814094441690246" }, "_hasShrinkwrap": false }, "7.0.0-3": { "name": "mem", "version": "7.0.0-3", "description": "Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/mem.git" }, "funding": "https://github.com/sindresorhus/mem?sponsor=1", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "https://sindresorhus.com" }, "engines": { "node": ">=10" }, "scripts": { "test": "xo && npm run build && tsd && ava", "build": "del-cli dist && tsc", "prepack": "npm run build" }, "main": "dist", "types": "dist/index.d.ts", "keywords": [ "memoize", "function", "mem", "memoization", "cache", "caching", "optimize", "performance", "ttl", "expire", "promise" ], "dependencies": { "map-age-cleaner": "^0.1.3", "mimic-fn": "^3.0.0" }, "devDependencies": { "@sindresorhus/tsconfig": "^0.7.0", "ava": "^3.13.0", "del-cli": "^3.0.1", "delay": "^4.1.0", "serialize-javascript": "^5.0.1", "tsd": "^0.13.1", "typescript": "^4.0.3", "xo": "^0.33.1" }, "readme": "# mem [![Build Status](https://travis-ci.org/sindresorhus/mem.svg?branch=master)](https://travis-ci.org/sindresorhus/mem)\n\n> [Memoize](https://en.wikipedia.org/wiki/Memoization) functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input\n\nMemory is automatically released when an item expires or the cache is cleared.\n\nBy default, **only the first argument is considered** and it only works with [primitives](https://developer.mozilla.org/en-US/docs/Glossary/Primitive). If you need to cache multiple arguments or cache `object`s *by value*, have a look at alternative [caching strategies](#caching-strategy) below.\n\n## Install\n\n```\n$ npm install mem\n```\n\n## Usage\n\n```js\nconst mem = require('mem');\n\nlet i = 0;\nconst counter = () => ++i;\nconst memoized = mem(counter);\n\nmemoized('foo');\n//=> 1\n\n// Cached as it's the same argument\nmemoized('foo');\n//=> 1\n\n// Not cached anymore as the argument changed\nmemoized('bar');\n//=> 2\n\nmemoized('bar');\n//=> 2\n\n// Only the first argument is considered by default\nmemoized('bar', 'foo');\n//=> 2\n```\n\n##### Works fine with promise returning functions\n\n```js\nconst mem = require('mem');\n\nlet i = 0;\nconst counter = async () => ++i;\nconst memoized = mem(counter);\n\n(async () => {\n\tconsole.log(await memoized());\n\t//=> 1\n\n\t// The return value didn't increase as it's cached\n\tconsole.log(await memoized());\n\t//=> 1\n})();\n```\n\n```js\nconst mem = require('mem');\nconst got = require('got');\nconst delay = require('delay');\n\nconst memGot = mem(got, {maxAge: 1000});\n\n(async () => {\n\tawait memGot('https://sindresorhus.com');\n\n\t// This call is cached\n\tawait memGot('https://sindresorhus.com');\n\n\tawait delay(2000);\n\n\t// This call is not cached as the cache has expired\n\tawait memGot('https://sindresorhus.com');\n})();\n```\n\n### Caching strategy\n\nBy default, only the first argument is compared via exact equality (`===`) to determine whether a call is identical.\n\n```js\nconst power = mem((a, b) => Math.power(a, b));\n\npower(2, 2); // => 4, stored in cache with the key 2 (number)\npower(2, 3); // => 4, retrieved from cache at key 2 (number), it's wrong\n```\n\nYou will have to use the `cache` and `cacheKey` options appropriate to your function. In this specific case, the following could work:\n\n```js\nconst power = mem((a, b) => Math.power(a, b), {\n cacheKey: arguments_ => arguments_.join(',')\n});\n\npower(2, 2); // => 4, stored in cache with the key '2,2' (both arguments as one string)\npower(2, 3); // => 8, stored in cache with the key '2,3'\n```\n\nMore advanced examples follow.\n\n#### Example: Options-like argument\n\nIf your function accepts an object, it won't be memoized out of the box:\n\n```js\nconst heavyMemoizedOperation = mem(heavyOperation);\n\nheavyMemoizedOperation({full: true}); // Stored in cache with the object as key\nheavyMemoizedOperation({full: true}); // Stored in cache with the object as key, again\n// The objects look the same but for JS they're two different objects\n```\n\nYou might want to serialize or hash them, for example using `JSON.stringify` or something like [serialize-javascript](https://github.com/yahoo/serialize-javascript), which can also serialize `RegExp`, `Date` and so on.\n\n```js\nconst heavyMemoizedOperation = mem(heavyOperation, {cacheKey: JSON.stringify});\n\nheavyMemoizedOperation({full: true}); // Stored in cache with the key '[{\"full\":true}]' (string)\nheavyMemoizedOperation({full: true}); // Retrieved from cache\n```\n\nThe same solution also works if it accepts multiple serializable objects:\n\n```js\nconst heavyMemoizedOperation = mem(heavyOperation, {cacheKey: JSON.stringify});\n\nheavyMemoizedOperation('hello', {full: true}); // Stored in cache with the key '[\"hello\",{\"full\":true}]' (string)\nheavyMemoizedOperation('hello', {full: true}); // Retrieved from cache\n```\n\n#### Example: Multiple non-serializable arguments\n\nIf your function accepts multiple arguments that aren't supported by `JSON.stringify` (e.g. DOM elements and functions), you can instead extend the initial exact equality (`===`) to work on multiple arguments using [`many-keys-map`](https://github.com/fregante/many-keys-map):\n\n```js\nconst ManyKeysMap = require('many-keys-map');\n\nconst addListener = (emitter, eventName, listener) => emitter.on(eventName, listener);\n\nconst addOneListener = mem(addListener, {\n\tcacheKey: arguments_ => arguments_, // Use *all* the arguments as key\n\tcache: new ManyKeysMap() // Correctly handles all the arguments for exact equality\n});\n\naddOneListener(header, 'click', console.log); // `addListener` is run, and it's cached with the `arguments` array as key\naddOneListener(header, 'click', console.log); // `addListener` is not run again\naddOneListener(mainContent, 'load', console.log); // `addListener` is run, and it's cached with the `arguments` array as key\n```\n\nBetter yet, if your function’s arguments are compatible with `WeakMap`, you should use [`deep-weak-map`](https://github.com/futpib/deep-weak-map) instead of `many-keys-map`. This will help avoid memory leaks.\n\n## API\n\n### mem(fn, options?)\n\n#### fn\n\nType: `Function`\n\nFunction to be memoized.\n\n#### options\n\nType: `object`\n\n##### maxAge\n\nType: `number`\\\nDefault: `Infinity`\n\nMilliseconds until the cache expires.\n\n##### cacheKey\n\nType: `Function`\\\nDefault: `arguments_ => arguments_[0]`\\\nExample: `arguments_ => JSON.stringify(arguments_)`\n\nDetermines the cache key for storing the result based on the function arguments. By default, **only the first argument is considered**.\n\nA `cacheKey` function can return any type supported by `Map` (or whatever structure you use in the `cache` option).\n\nRefer to the [caching strategies](#caching-strategy) section for more information.\n\n##### cache\n\nType: `object`\\\nDefault: `new Map()`\n\nUse a different cache storage. Must implement the following methods: `.has(key)`, `.get(key)`, `.set(key, value)`, `.delete(key)`, and optionally `.clear()`. You could for example use a `WeakMap` instead or [`quick-lru`](https://github.com/sindresorhus/quick-lru) for a LRU cache.\n\nRefer to the [caching strategies](#caching-strategy) section for more information.\n\n### mem.clear(fn)\n\nClear all cached data of a memoized function.\n\n#### fn\n\nType: `Function`\n\nMemoized function.\n\n## Tips\n\n### Cache statistics\n\nIf you want to know how many times your cache had a hit or a miss, you can make use of [stats-map](https://github.com/SamVerschueren/stats-map) as a replacement for the default cache.\n\n#### Example\n\n```js\nconst mem = require('mem');\nconst StatsMap = require('stats-map');\nconst got = require('got');\n\nconst cache = new StatsMap();\nconst memGot = mem(got, {cache});\n\n(async () => {\n\tawait memGot('https://sindresorhus.com');\n\tawait memGot('https://sindresorhus.com');\n\tawait memGot('https://sindresorhus.com');\n\n\tconsole.log(cache.stats);\n\t//=> {hits: 2, misses: 1}\n})();\n```\n\n## Related\n\n- [p-memoize](https://github.com/sindresorhus/p-memoize) - Memoize promise-returning & async functions\n\n---\n\n
\n\t\n\t\tGet professional support for this package with a Tidelift subscription\n\t\n\t
\n\t\n\t\tTidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.\n\t
\n
\n", "readmeFilename": "readme.md", "gitHead": "de486e4b344fd4f4315aecb4055a8c4e8e119d86", "bugs": { "url": "https://github.com/sindresorhus/mem/issues" }, "homepage": "https://github.com/sindresorhus/mem#readme", "_id": "mem@7.0.0-3", "_nodeVersion": "14.4.0", "_npmVersion": "6.14.5", "dist": { "integrity": "sha512-kUcydKLeeoGt0YyhawhBvZne2SlsBeXHWBKcgW7GGX3fJ3XT3ogsoCjVHkPl0Dfpz1XyZNUiZ9UcfK8nTl4Fvw==", "shasum": "d3c44d02713c56eb196ed959cc530c68474ec8cd", "tarball": "https://registry.npmjs.org/mem/-/mem-7.0.0-3.tgz", "fileCount": 5, "unpackedSize": 14571, "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffA3wCRA9TVsSAnZWagAAvrkP/jQb2B/WRzKm+OZGnMF9\nA0xWhoJpARxgYJedmzbDOXF9rdX8tFbNNfsX2ds3yUFR2Tn82XGfweUvHkp2\npsVBvZ9M2itGsVy/AMe+bAGBSSG8sXdHlTMLWna8X35xpKgXnVHCDZOl6HW1\nM6R27p2fXhpOz3o+7l+/T/vciIxYIZLFd4eZQ9Jfn6bzDnuN+Mf86Yp3vLKw\n/uAL3xXV5nsAilgR/5nWNuJB52+ce8Fj9lWXpCUIDRWRkV0Vc14bWH9R0w9y\nz5rRPTeCvspOQPO/6+1Y5sLmBoOZf7D4WdatWfh1vYOjBsNYmHN0RQtq99hm\nMFIZO+/Hf/K3wXYxOO/RHcsK2weQd5sD2u7fzjBbqqLcEUBMl8SuCK7OrQK5\nn7Y9HbwIIB+XEpSgZCYnt4NT50AwROMCcUFBLg8Cho8Omzi3PUPV9DCkXL63\ndfSpA2tbcUxHBLg34Zb14/K+QxZLM4IPj+8W0ntpLhPfDu+iQetphlr7LKDc\nR7tbNBcebZhMbuV4wA3xUizDL60HHZkkSQkN5gIftF3QYu7J4pIHXbLybVN6\nuFCsSXuwYZWSqbaNC9ZkcR6yrGYgX0Vi3JUrvkO+KU5wgbXw6fw9g83zOZ3K\nGlT0TOdnRUKsidQns1jeUW2VjdeBkP18q2CYhVnH0fFANIzIh2yyEg0qypHD\nN/Uk\r\n=1d8d\r\n-----END PGP SIGNATURE-----\r\n" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, { "name": "fregante", "email": "opensource@bfred.it" } ], "_npmUser": { "name": "fregante", "email": "opensource@bfred.it" }, "directories": {}, "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/mem_7.0.0-3_1601965551939_0.5177473435317104" }, "_hasShrinkwrap": false }, "8.0.0": { "name": "mem", "version": "8.0.0", "description": "Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/mem.git" }, "funding": "https://github.com/sindresorhus/mem?sponsor=1", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "https://sindresorhus.com" }, "engines": { "node": ">=10" }, "scripts": { "test": "xo && npm run build && tsd && ava", "build": "del-cli dist && tsc", "prepack": "npm run build" }, "main": "dist", "types": "dist/index.d.ts", "keywords": [ "memoize", "function", "mem", "memoization", "cache", "caching", "optimize", "performance", "ttl", "expire", "promise" ], "dependencies": { "map-age-cleaner": "^0.1.3", "mimic-fn": "^3.1.0" }, "devDependencies": { "@ava/typescript": "^1.1.1", "@sindresorhus/tsconfig": "^0.7.0", "@types/serialize-javascript": "^4.0.0", "ava": "^3.13.0", "del-cli": "^3.0.1", "delay": "^4.4.0", "serialize-javascript": "^5.0.1", "tsd": "^0.13.1", "typescript": "^4.0.3", "xo": "^0.33.1" }, "ava": { "files": [ "test.ts" ], "timeout": "1m", "typescript": { "rewritePaths": { "./": "dist/" } } }, "xo": { "rules": { "@typescript-eslint/member-ordering": "off", "@typescript-eslint/no-var-requires": "off", "@typescript-eslint/no-empty-function": "off" } }, "gitHead": "3bbfa2439df58e46ba917aa3e7eb0d9d0bccc0f2", "bugs": { "url": "https://github.com/sindresorhus/mem/issues" }, "homepage": "https://github.com/sindresorhus/mem#readme", "_id": "mem@8.0.0", "_nodeVersion": "14.11.0", "_npmVersion": "6.14.8", "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, "dist": { "integrity": "sha512-qrcJOe6uD+EW8Wrci1Vdiua/15Xw3n/QnaNXE7varnB6InxSk7nu3/i5jfy3S6kWxr8WYJ6R1o0afMUtvorTsA==", "shasum": "b5e4b6d2d241c6296da05436173b4d0c7ae1f9ac", "tarball": "https://registry.npmjs.org/mem/-/mem-8.0.0.tgz", "fileCount": 5, "unpackedSize": 15059, "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfgeCRCRA9TVsSAnZWagAAwjsP/jh/hMLThPYEBbmz58b8\nA62N2CN+gNR/q0FWbs8A9CFzIdd0XccRXQyKjRA6Z5Sg9DMNoaGVazhBtRh+\nStjGr3JZ2ZANELeTWalZEZ+7Agql7un2VaqcmMmbyaBNgNOSxaEWNhfHiRlD\nEq9aXXSEPjIHLF6UArdQ/eqLesb40CJZJ5/mjXNtJKETJpLLOV2RWnwUuuyK\nrnXqKczmNv0n/zGk4WZh484ICggFOFnzlYpb1eaDHs0rRogx07q3cuI2jDYH\nLFRosbBIGBWUmVEfiyyapXEQYqzKZbOnyjw4IbsszAv+s4RIOJQYQVEMS7xX\nB+fFoowfqmO9KqUiWENXhFwZOd4JRGY7VsUIdb2lo3vwFyxPOleXEQ1VR9jG\nm5P2mhW2f8dqTXYXjMrYLStmpdTeH+TPtWABTRavQvz4P3aGHa9ZiMyxKGkV\ndAEEzLfPmJg94RkLgowm1coFMK09nJoeHZPoFenKusZEBWfHpgp7B6N9pw9u\n10l2BDwwDDhjXl1BjPVKcnLhhjCeGiSma9fEICbKIT7ZxJKPJb2V8IuJhYNg\nGUGUJ90LtMFaKhCMiIYgs7KFrinyBCygpsfeM20A9BfrfhSh8KyZHKbKHFq4\nk0NBKFLBgZ63TlL0Dm4DAF8IxxIMuXdQcmaRNgQWhO4C5fWpqQDKFuAtU31o\nwSW2\r\n=uC19\r\n-----END PGP SIGNATURE-----\r\n" }, "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, { "name": "fregante", "email": "opensource@bfred.it" } ], "directories": {}, "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/mem_8.0.0_1602347152712_0.37521709756771005" }, "_hasShrinkwrap": false } }, "readme": "# mem [![Build Status](https://travis-ci.com/sindresorhus/mem.svg?branch=master)](https://travis-ci.com/github/sindresorhus/mem)\n\n> [Memoize](https://en.wikipedia.org/wiki/Memoization) functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input\n\nMemory is automatically released when an item expires or the cache is cleared.\n\nBy default, **only the first argument is considered** and it only works with [primitives](https://developer.mozilla.org/en-US/docs/Glossary/Primitive). If you need to cache multiple arguments or cache `object`s *by value*, have a look at alternative [caching strategies](#caching-strategy) below.\n\n## Install\n\n```\n$ npm install mem\n```\n\n## Usage\n\n```js\nconst mem = require('mem');\n\nlet i = 0;\nconst counter = () => ++i;\nconst memoized = mem(counter);\n\nmemoized('foo');\n//=> 1\n\n// Cached as it's the same argument\nmemoized('foo');\n//=> 1\n\n// Not cached anymore as the argument changed\nmemoized('bar');\n//=> 2\n\nmemoized('bar');\n//=> 2\n\n// Only the first argument is considered by default\nmemoized('bar', 'foo');\n//=> 2\n```\n\n##### Works fine with promise returning functions\n\n```js\nconst mem = require('mem');\n\nlet i = 0;\nconst counter = async () => ++i;\nconst memoized = mem(counter);\n\n(async () => {\n\tconsole.log(await memoized());\n\t//=> 1\n\n\t// The return value didn't increase as it's cached\n\tconsole.log(await memoized());\n\t//=> 1\n})();\n```\n\n```js\nconst mem = require('mem');\nconst got = require('got');\nconst delay = require('delay');\n\nconst memGot = mem(got, {maxAge: 1000});\n\n(async () => {\n\tawait memGot('https://sindresorhus.com');\n\n\t// This call is cached\n\tawait memGot('https://sindresorhus.com');\n\n\tawait delay(2000);\n\n\t// This call is not cached as the cache has expired\n\tawait memGot('https://sindresorhus.com');\n})();\n```\n\n### Caching strategy\n\nBy default, only the first argument is compared via exact equality (`===`) to determine whether a call is identical.\n\n```js\nconst power = mem((a, b) => Math.power(a, b));\n\npower(2, 2); // => 4, stored in cache with the key 2 (number)\npower(2, 3); // => 4, retrieved from cache at key 2 (number), it's wrong\n```\n\nYou will have to use the `cache` and `cacheKey` options appropriate to your function. In this specific case, the following could work:\n\n```js\nconst power = mem((a, b) => Math.power(a, b), {\n cacheKey: arguments_ => arguments_.join(',')\n});\n\npower(2, 2); // => 4, stored in cache with the key '2,2' (both arguments as one string)\npower(2, 3); // => 8, stored in cache with the key '2,3'\n```\n\nMore advanced examples follow.\n\n#### Example: Options-like argument\n\nIf your function accepts an object, it won't be memoized out of the box:\n\n```js\nconst heavyMemoizedOperation = mem(heavyOperation);\n\nheavyMemoizedOperation({full: true}); // Stored in cache with the object as key\nheavyMemoizedOperation({full: true}); // Stored in cache with the object as key, again\n// The objects look the same but for JS they're two different objects\n```\n\nYou might want to serialize or hash them, for example using `JSON.stringify` or something like [serialize-javascript](https://github.com/yahoo/serialize-javascript), which can also serialize `RegExp`, `Date` and so on.\n\n```js\nconst heavyMemoizedOperation = mem(heavyOperation, {cacheKey: JSON.stringify});\n\nheavyMemoizedOperation({full: true}); // Stored in cache with the key '[{\"full\":true}]' (string)\nheavyMemoizedOperation({full: true}); // Retrieved from cache\n```\n\nThe same solution also works if it accepts multiple serializable objects:\n\n```js\nconst heavyMemoizedOperation = mem(heavyOperation, {cacheKey: JSON.stringify});\n\nheavyMemoizedOperation('hello', {full: true}); // Stored in cache with the key '[\"hello\",{\"full\":true}]' (string)\nheavyMemoizedOperation('hello', {full: true}); // Retrieved from cache\n```\n\n#### Example: Multiple non-serializable arguments\n\nIf your function accepts multiple arguments that aren't supported by `JSON.stringify` (e.g. DOM elements and functions), you can instead extend the initial exact equality (`===`) to work on multiple arguments using [`many-keys-map`](https://github.com/fregante/many-keys-map):\n\n```js\nconst ManyKeysMap = require('many-keys-map');\n\nconst addListener = (emitter, eventName, listener) => emitter.on(eventName, listener);\n\nconst addOneListener = mem(addListener, {\n\tcacheKey: arguments_ => arguments_, // Use *all* the arguments as key\n\tcache: new ManyKeysMap() // Correctly handles all the arguments for exact equality\n});\n\naddOneListener(header, 'click', console.log); // `addListener` is run, and it's cached with the `arguments` array as key\naddOneListener(header, 'click', console.log); // `addListener` is not run again\naddOneListener(mainContent, 'load', console.log); // `addListener` is run, and it's cached with the `arguments` array as key\n```\n\nBetter yet, if your function’s arguments are compatible with `WeakMap`, you should use [`deep-weak-map`](https://github.com/futpib/deep-weak-map) instead of `many-keys-map`. This will help avoid memory leaks.\n\n## API\n\n### mem(fn, options?)\n\n#### fn\n\nType: `Function`\n\nFunction to be memoized.\n\n#### options\n\nType: `object`\n\n##### maxAge\n\nType: `number`\\\nDefault: `Infinity`\n\nMilliseconds until the cache expires.\n\n##### cacheKey\n\nType: `Function`\\\nDefault: `arguments_ => arguments_[0]`\\\nExample: `arguments_ => JSON.stringify(arguments_)`\n\nDetermines the cache key for storing the result based on the function arguments. By default, **only the first argument is considered**.\n\nA `cacheKey` function can return any type supported by `Map` (or whatever structure you use in the `cache` option).\n\nRefer to the [caching strategies](#caching-strategy) section for more information.\n\n##### cache\n\nType: `object`\\\nDefault: `new Map()`\n\nUse a different cache storage. Must implement the following methods: `.has(key)`, `.get(key)`, `.set(key, value)`, `.delete(key)`, and optionally `.clear()`. You could for example use a `WeakMap` instead or [`quick-lru`](https://github.com/sindresorhus/quick-lru) for a LRU cache.\n\nRefer to the [caching strategies](#caching-strategy) section for more information.\n\n### mem.clear(fn)\n\nClear all cached data of a memoized function.\n\n#### fn\n\nType: `Function`\n\nMemoized function.\n\n## Tips\n\n### Cache statistics\n\nIf you want to know how many times your cache had a hit or a miss, you can make use of [stats-map](https://github.com/SamVerschueren/stats-map) as a replacement for the default cache.\n\n#### Example\n\n```js\nconst mem = require('mem');\nconst StatsMap = require('stats-map');\nconst got = require('got');\n\nconst cache = new StatsMap();\nconst memGot = mem(got, {cache});\n\n(async () => {\n\tawait memGot('https://sindresorhus.com');\n\tawait memGot('https://sindresorhus.com');\n\tawait memGot('https://sindresorhus.com');\n\n\tconsole.log(cache.stats);\n\t//=> {hits: 2, misses: 1}\n})();\n```\n\n## Related\n\n- [p-memoize](https://github.com/sindresorhus/p-memoize) - Memoize promise-returning & async functions\n\n---\n\n
\n\t\n\t\tGet professional support for this package with a Tidelift subscription\n\t\n\t
\n\t\n\t\tTidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.\n\t
\n
\n", "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, { "name": "fregante", "email": "opensource@bfred.it" } ], "time": { "modified": "2020-10-10T16:25:56.714Z", "created": "2013-01-22T23:16:13.120Z", "0.0.1": "2013-01-22T23:16:15.354Z", "0.1.0": "2015-12-21T18:44:14.279Z", "0.1.1": "2016-02-02T15:53:17.433Z", "1.0.0": "2016-10-19T17:34:31.486Z", "1.1.0": "2016-10-19T18:05:26.119Z", "2.0.0": "2017-09-25T06:32:08.213Z", "3.0.0": "2017-10-11T15:56:14.080Z", "3.0.1": "2018-06-20T06:38:02.452Z", "4.0.0": "2018-08-27T17:33:38.386Z", "4.1.0": "2019-01-30T08:45:27.864Z", "4.2.0": "2019-03-12T17:41:47.237Z", "4.3.0": "2019-03-31T19:09:03.906Z", "5.0.0": "2019-05-17T17:25:34.041Z", "5.1.0": "2019-06-15T13:14:37.532Z", "5.1.1": "2019-06-29T20:05:51.216Z", "6.0.0": "2019-11-11T09:23:28.762Z", "6.0.1": "2019-11-29T13:29:37.074Z", "6.1.0": "2020-04-12T14:23:18.378Z", "6.1.1": "2020-08-29T21:55:55.811Z", "7.0.0-0": "2020-10-01T02:21:25.656Z", "7.0.0-1": "2020-10-01T02:48:25.698Z", "7.0.0-2": "2020-10-01T09:07:02.292Z", "7.0.0-3": "2020-10-06T06:25:52.072Z", "8.0.0": "2020-10-10T16:25:52.870Z" }, "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "https://sindresorhus.com" }, "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/mem.git" }, "keywords": [ "memoize", "function", "mem", "memoization", "cache", "caching", "optimize", "performance", "ttl", "expire", "promise" ], "readmeFilename": "readme.md", "homepage": "https://github.com/sindresorhus/mem#readme", "bugs": { "url": "https://github.com/sindresorhus/mem/issues" }, "license": "MIT", "users": { "antixrist": true, "psychollama": true, "quocnguyen": true, "sasquatch": true, "joelwallis": true, "pldin601": true, "cr8tiv": true, "daniel-zahariev": true, "xch": true } }