{"_id":"cached-factory","_rev":"5-9ffebd7867645d595019720bb285b64e","name":"cached-factory","dist-tags":{"latest":"0.3.0"},"versions":{"0.0.1":{"name":"cached-factory","version":"0.0.1","author":{"name":"joshuakgoldberg","email":"npm@joshuakgoldberg.com"},"license":"MIT","_id":"cached-factory@0.0.1","maintainers":[{"name":"joshuakgoldberg","email":"npm@joshuakgoldberg.com"}],"homepage":"https://github.com/JoshuaKGoldberg/cached-factory#readme","bugs":{"url":"https://github.com/JoshuaKGoldberg/cached-factory/issues"},"dist":{"shasum":"0dc20eba3c79d41b9ca640273e4b98a1ceccb07c","tarball":"https://registry.npmjs.org/cached-factory/-/cached-factory-0.0.1.tgz","fileCount":6,"integrity":"sha512-nlhbhyJwz++jwl5wJR9oV3E69eCfNuWbtTia+zZslORBDBCk7hwRO1EoUbHsA1c5kOGP6vWIPPSYAxA5y5VcMw==","signatures":[{"sig":"MEUCIB91UkzD1W3AOXnPfvQ/pGK6X6dBSNysSfE8jOZ8pDkTAiEAy47wt35ugBJ0/mnqX4XWwP6X8w9GchQGyiHdHQ/MR1k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/cached-factory@0.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":9548},"main":"./lib/index.js","type":"module","types":"./lib/index.d.ts","engines":{"node":">=18"},"gitHead":"c1b08d16f23387827dfa9b678b0b38726a535bc8","scripts":{"tsc":"tsc","lint":"eslint . .*js --max-warnings 0 --report-unused-disable-directives","test":"vitest","build":"tsup","format":"prettier \"**/*\" --ignore-unknown","lint:md":"markdownlint \"**/*.md\" \".github/**/*.md\" --rules sentences-per-line","prepare":"husky install","lint:knip":"knip","format:write":"pnpm format --write","lint:package":"npmPkgJsonLint .","lint:packages":"pnpm dedupe --check","lint:spelling":"cspell \"**\" \".github/**/*\"","should-semantic-release":"should-semantic-release --verbose"},"_npmUser":{"name":"joshuakgoldberg","email":"npm@joshuakgoldberg.com"},"repository":{"url":"git+https://github.com/JoshuaKGoldberg/cached-factory.git","type":"git"},"_npmVersion":"9.6.7","description":"Creates and caches values under keys. 🏭","directories":{},"lint-staged":{"*":"prettier --ignore-unknown --write"},"_nodeVersion":"18.17.1","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"packageManager":"pnpm@8.5.0","devDependencies":{"knip":"^2.20.1","tsup":"^7.2.0","husky":"^8.0.3","cspell":"^7.0.1","eslint":"^8.48.0","vitest":"^0.34.3","prettier":"^3.0.2","release-it":"^16.1.5","typescript":"^5.1.6","lint-staged":"^14.0.1","markdownlint":"^0.30.0","@types/eslint":"^8.44.2","eslint-plugin-n":"^16.0.2","markdownlint-cli":"^0.35.0","console-fail-test":"^0.2.3","eslint-plugin-yml":"^1.8.0","sentences-per-line":"^0.2.1","yaml-eslint-parser":"^1.2.2","eslint-plugin-jsdoc":"^46.5.0","eslint-plugin-jsonc":"^2.9.0","jsonc-eslint-parser":"^2.3.0","eslint-plugin-import":"^2.28.1","eslint-plugin-regexp":"^1.15.0","eslint-plugin-vitest":"^0.2.8","npm-package-json-lint":"^7.0.0","prettier-plugin-curly":"^0.1.2","eslint-config-prettier":"^9.0.0","eslint-plugin-markdown":"^3.0.1","should-semantic-release":"^0.1.1","@typescript-eslint/parser":"^6.4.1","@vitest/coverage-istanbul":"^0.34.3","eslint-plugin-deprecation":"^1.5.0","eslint-plugin-no-only-tests":"^3.1.0","eslint-plugin-perfectionist":"^1.5.1","prettier-plugin-packagejson":"^2.4.5","eslint-plugin-eslint-comments":"^3.2.0","@typescript-eslint/eslint-plugin":"^6.4.1","npm-package-json-lint-config-default":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/cached-factory_0.0.1_1693140368400_0.7575521505063867","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"cached-factory","version":"0.0.2","author":{"name":"joshuakgoldberg","email":"npm@joshuakgoldberg.com"},"license":"MIT","_id":"cached-factory@0.0.2","maintainers":[{"name":"joshuakgoldberg","email":"npm@joshuakgoldberg.com"}],"homepage":"https://github.com/JoshuaKGoldberg/cached-factory#readme","bugs":{"url":"https://github.com/JoshuaKGoldberg/cached-factory/issues"},"dist":{"shasum":"9c42c44297c8478b8ee853bc0544547b4a549c41","tarball":"https://registry.npmjs.org/cached-factory/-/cached-factory-0.0.2.tgz","fileCount":6,"integrity":"sha512-4mhebGQ8YyvlDAX+zOHso5MezPi2pP11ZFE7vYhDIOJifsxEi7R5geB/nrLBYzQH5nwZ9kNsLAjM+WBj6osLDg==","signatures":[{"sig":"MEQCICsPGNh7mJMyn4MJ4orYqUKGNEsclPC4CyVLw0xt6QWhAiAuwLjUygTFwh/8IsNpBqzj0EjBnNE8H0oFJ/YsiPy/qQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/cached-factory@0.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v0.2"}},"unpackedSize":9553},"main":"./lib/index.js","type":"module","types":"./lib/index.d.ts","engines":{"node":">=18"},"gitHead":"c632535dd0117e914cae42b0aa7aa9009318026b","scripts":{"tsc":"tsc","lint":"eslint . .*js --max-warnings 0 --report-unused-disable-directives","test":"vitest","build":"tsup","format":"prettier \"**/*\" --ignore-unknown","lint:md":"markdownlint \"**/*.md\" \".github/**/*.md\" --rules sentences-per-line","prepare":"husky install","lint:knip":"knip","format:write":"pnpm format --write","lint:packages":"pnpm dedupe --check","lint:spelling":"cspell \"**\" \".github/**/*\"","lint:package-json":"npmPkgJsonLint .","should-semantic-release":"should-semantic-release --verbose"},"_npmUser":{"name":"joshuakgoldberg","email":"npm@joshuakgoldberg.com"},"repository":{"url":"git+https://github.com/JoshuaKGoldberg/cached-factory.git","type":"git"},"_npmVersion":"9.6.7","description":"Creates and caches values under keys. 🏭","directories":{},"lint-staged":{"*":"prettier --ignore-unknown --write"},"_nodeVersion":"18.17.1","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"packageManager":"pnpm@8.5.0","devDependencies":{"knip":"^2.20.1","tsup":"^7.2.0","husky":"^8.0.3","cspell":"^7.0.1","eslint":"^8.48.0","vitest":"^0.34.3","prettier":"^3.0.2","release-it":"^16.1.5","typescript":"^5.1.6","lint-staged":"^14.0.1","markdownlint":"^0.30.0","@types/eslint":"^8.44.2","eslint-plugin-n":"^16.0.2","markdownlint-cli":"^0.35.0","console-fail-test":"^0.2.3","eslint-plugin-yml":"^1.8.0","sentences-per-line":"^0.2.1","yaml-eslint-parser":"^1.2.2","eslint-plugin-jsdoc":"^46.5.0","eslint-plugin-jsonc":"^2.9.0","jsonc-eslint-parser":"^2.3.0","eslint-plugin-import":"^2.28.1","eslint-plugin-regexp":"^1.15.0","eslint-plugin-vitest":"^0.2.8","npm-package-json-lint":"^7.0.0","prettier-plugin-curly":"^0.1.2","eslint-config-prettier":"^9.0.0","eslint-plugin-markdown":"^3.0.1","should-semantic-release":"^0.1.1","@typescript-eslint/parser":"^6.4.1","@vitest/coverage-istanbul":"^0.34.3","eslint-plugin-deprecation":"^1.5.0","eslint-plugin-no-only-tests":"^3.1.0","eslint-plugin-perfectionist":"^1.5.1","prettier-plugin-packagejson":"^2.4.5","eslint-plugin-eslint-comments":"^3.2.0","@typescript-eslint/eslint-plugin":"^6.4.1","npm-package-json-lint-config-default":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/cached-factory_0.0.2_1693839611908_0.1325501797248252","host":"s3://npm-registry-packages"}},"0.1.0":{"name":"cached-factory","version":"0.1.0","author":{"name":"joshuakgoldberg","email":"npm@joshuakgoldberg.com"},"license":"MIT","_id":"cached-factory@0.1.0","maintainers":[{"name":"joshuakgoldberg","email":"npm@joshuakgoldberg.com"}],"homepage":"https://github.com/JoshuaKGoldberg/cached-factory#readme","bugs":{"url":"https://github.com/JoshuaKGoldberg/cached-factory/issues"},"dist":{"shasum":"ef03439ec03f10741f594e75ce0cd6307bb0eaa0","tarball":"https://registry.npmjs.org/cached-factory/-/cached-factory-0.1.0.tgz","fileCount":6,"integrity":"sha512-IGOSWu+NuED5UzCRmBeqQPZ8z7SkgrD/nN67W2iY1Qv83CVhevyMexkGclJ86saXisIqxoOnbeiTWvsCHRqJBw==","signatures":[{"sig":"MEYCIQCdMHpTrOGUE5nJm84ZK8h2Id32Yw6vXYgyhHTqYmVlygIhALdiHbQiBvuhXqhLPs6IRSIq4NTY/lSrMvJXFnyHSiVM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9694},"main":"./lib/index.js","type":"module","types":"./lib/index.d.ts","engines":{"node":">=18"},"gitHead":"30ce74b3761cd0f9f5c7612b5a9ef9aaaf26e687","scripts":{"tsc":"tsc","lint":"eslint . .*js --max-warnings 0 --report-unused-disable-directives","test":"vitest","build":"tsup","format":"prettier \"**/*\" --ignore-unknown","lint:md":"markdownlint \"**/*.md\" \".github/**/*.md\" --rules sentences-per-line","prepare":"husky install","lint:knip":"knip","format:write":"pnpm format --write","lint:packages":"pnpm dedupe --check","lint:spelling":"cspell \"**\" \".github/**/*\"","lint:package-json":"npmPkgJsonLint .","should-semantic-release":"should-semantic-release --verbose"},"_npmUser":{"name":"joshuakgoldberg","email":"npm@joshuakgoldberg.com"},"repository":{"url":"git+https://github.com/JoshuaKGoldberg/cached-factory.git","type":"git"},"_npmVersion":"10.8.1","description":"Creates and caches values under keys. 🏭","directories":{},"lint-staged":{"*":"prettier --ignore-unknown --write"},"_nodeVersion":"22.4.1","_hasShrinkwrap":false,"packageManager":"pnpm@9.15.0","devDependencies":{"knip":"^2.20.1","tsup":"^7.2.0","husky":"^8.0.3","cspell":"^7.0.1","eslint":"^8.48.0","vitest":"^0.34.3","prettier":"^3.0.2","release-it":"^16.1.5","typescript":"^5.1.6","lint-staged":"^14.0.1","markdownlint":"^0.30.0","@types/eslint":"^8.44.2","eslint-plugin-n":"^16.0.2","markdownlint-cli":"^0.35.0","console-fail-test":"^0.2.3","eslint-plugin-yml":"^1.8.0","sentences-per-line":"^0.2.1","yaml-eslint-parser":"^1.2.2","eslint-plugin-jsdoc":"^46.5.0","eslint-plugin-jsonc":"^2.9.0","jsonc-eslint-parser":"^2.3.0","eslint-plugin-import":"^2.28.1","eslint-plugin-regexp":"^1.15.0","eslint-plugin-vitest":"^0.2.8","npm-package-json-lint":"^7.0.0","prettier-plugin-curly":"^0.1.2","eslint-config-prettier":"^9.0.0","eslint-plugin-markdown":"^3.0.1","should-semantic-release":"^0.1.1","@typescript-eslint/parser":"^6.4.1","@vitest/coverage-istanbul":"^0.34.3","eslint-plugin-deprecation":"^1.5.0","eslint-plugin-no-only-tests":"^3.1.0","eslint-plugin-perfectionist":"^1.5.1","prettier-plugin-packagejson":"^2.4.5","eslint-plugin-eslint-comments":"^3.2.0","@typescript-eslint/eslint-plugin":"^6.4.1","npm-package-json-lint-config-default":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/cached-factory_0.1.0_1734674295105_0.058608695122747356","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"cached-factory","version":"0.2.0","author":{"name":"joshuakgoldberg","email":"npm@joshuakgoldberg.com"},"license":"MIT","_id":"cached-factory@0.2.0","maintainers":[{"name":"joshuakgoldberg","email":"npm@joshuakgoldberg.com"}],"homepage":"https://github.com/JoshuaKGoldberg/cached-factory#readme","bugs":{"url":"https://github.com/JoshuaKGoldberg/cached-factory/issues"},"dist":{"shasum":"04825c412377bd830fc35e19a64f1daeeca3ec25","tarball":"https://registry.npmjs.org/cached-factory/-/cached-factory-0.2.0.tgz","fileCount":7,"integrity":"sha512-6XGkilRVhace8gARfWVvkjyWoazCp21VUQXdDyWEcAz3sHSwXji76srbLfJ6BcHRAZveW9ICYprhqsdoRYZ+YQ==","signatures":[{"sig":"MEUCICqRR4JO7N11K4DHJxse/XoiDjl7G8zPBkYh5+5p4Ac1AiEA2vdum4p99aNiHFrK4d1jDlKA5dBXw5R43dHgUVgl4OM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/cached-factory@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":9935},"main":"lib/index.js","type":"module","types":"./lib/index.d.ts","engines":{"node":">=18"},"gitHead":"9ef6d4e6ed2102418505b823a41c61df894dcfe8","scripts":{"tsc":"tsc","lint":"eslint . --max-warnings 0","test":"vitest","build":"tsdown","format":"prettier .","prepare":"husky","lint:knip":"knip","format:write":"pnpm format --write","lint:packages":"pnpm dedupe --check","lint:spelling":"cspell \"**\" \".github/**/*\""},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:58f0597a-8ce9-4db9-b723-d7532437f85b"}},"repository":{"url":"git+https://github.com/JoshuaKGoldberg/cached-factory.git","type":"git"},"_npmVersion":"11.12.1","description":"Creates and caches values under keys. 🏭","directories":{},"lint-staged":{"*":"prettier --ignore-unknown --write"},"_nodeVersion":"24.15.0","publishConfig":{"provenance":true},"_hasShrinkwrap":false,"packageManager":"pnpm@10.33.2","devDependencies":{"knip":"6.7.0","husky":"9.1.7","cspell":"10.0.0","eslint":"10.2.1","tsdown":"0.21.10","vitest":"4.1.5","prettier":"3.8.3","@eslint/js":"10.0.1","release-it":"20.0.1","typescript":"6.0.3","@types/node":"25.6.0","lint-staged":"16.4.0","eslint-plugin-n":"17.24.0","@eslint/markdown":"8.0.1","console-fail-test":"0.6.1","eslint-plugin-yml":"3.3.1","typescript-eslint":"8.59.0","prettier-plugin-sh":"0.18.1","@vitest/coverage-v8":"4.1.5","eslint-plugin-jsdoc":"62.9.0","eslint-plugin-jsonc":"3.1.2","eslint-plugin-regexp":"3.1.0","@vitest/eslint-plugin":"1.6.16","create-typescript-app":"2.60.1","prettier-plugin-curly":"0.4.1","eslint-plugin-package-json":"0.91.1","eslint-plugin-perfectionist":"5.9.0","prettier-plugin-packagejson":"3.0.2","@release-it/conventional-changelog":"11.0.0","prettier-plugin-sentences-per-line":"0.2.3","@eslint-community/eslint-plugin-eslint-comments":"4.7.1"},"_npmOperationalInternal":{"tmp":"tmp/cached-factory_0.2.0_1777213583377_0.18840711918182262","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"cached-factory","version":"0.3.0","description":"Creates and caches values under keys. 🏭","repository":{"type":"git","url":"git+https://github.com/JoshuaKGoldberg/cached-factory.git"},"license":"MIT","author":{"name":"joshuakgoldberg","email":"npm@joshuakgoldberg.com"},"type":"module","main":"lib/index.js","scripts":{"build":"tsdown","format":"prettier .","format:write":"pnpm format --write","lint":"eslint . --max-warnings 0","lint:knip":"knip","lint:packages":"pnpm dedupe --check","lint:spelling":"cspell \"**\" \".github/**/*\"","prepare":"husky","test":"vitest","tsc":"tsc"},"lint-staged":{"*":"prettier --ignore-unknown --write"},"devDependencies":{"@eslint-community/eslint-plugin-eslint-comments":"4.7.1","@eslint/js":"10.0.1","@eslint/markdown":"8.0.1","@release-it/conventional-changelog":"11.0.0","@types/node":"25.9.0","@vitest/coverage-v8":"4.1.5","@vitest/eslint-plugin":"1.6.16","console-fail-test":"0.6.1","create-typescript-app":"2.60.1","cspell":"10.0.0","eslint":"10.4.0","eslint-plugin-jsdoc":"63.0.0","eslint-plugin-jsonc":"3.2.0","eslint-plugin-n":"18.1.0","eslint-plugin-package-json":"1.3.0","eslint-plugin-perfectionist":"5.9.0","eslint-plugin-regexp":"3.1.0","eslint-plugin-yml":"3.4.0","husky":"9.1.7","knip":"6.16.0","lint-staged":"17.0.2","prettier":"3.8.3","prettier-plugin-curly":"0.4.1","prettier-plugin-packagejson":"3.0.2","prettier-plugin-sentences-per-line":"0.2.3","prettier-plugin-sh":"0.18.1","release-it":"20.2.0","tsdown":"0.22.0","typescript":"6.0.3","typescript-eslint":"8.61.0","vitest":"4.1.5"},"packageManager":"pnpm@11.5.0","engines":{"node":">=18"},"publishConfig":{"provenance":true},"gitHead":"a1ed6ee3aa8d58d4cd6bcfa1713f0f7a2e9d0d0b","types":"./lib/index.d.ts","_id":"cached-factory@0.3.0","bugs":{"url":"https://github.com/JoshuaKGoldberg/cached-factory/issues"},"homepage":"https://github.com/JoshuaKGoldberg/cached-factory#readme","_nodeVersion":"24.16.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-8PWf78SYJg9kGpUNlqOlg2iE4nu/iW7FidBVdvEZPy0GJRUyN91X7q0VzX/oyJE6bGrgr/bR0VhcGF87vgeQaw==","shasum":"4fbef0c10f9b54cdc83ce49c113993487a9d25db","tarball":"https://registry.npmjs.org/cached-factory/-/cached-factory-0.3.0.tgz","fileCount":13,"unpackedSize":13048,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/cached-factory@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC69+/se0JYOu+P7eFGpDelvwmuH/aA1VDNVzWHXl6BnwIgCfd7HtDZtVQlCRJaOmSDwgJvzTfJkcrgvluOawvZYdw="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:58f0597a-8ce9-4db9-b723-d7532437f85b"}},"directories":{},"maintainers":[{"name":"joshuakgoldberg","email":"npm@joshuakgoldberg.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cached-factory_0.3.0_1781473028453_0.5163593121020724"},"_hasShrinkwrap":false}},"time":{"created":"2023-08-27T12:46:08.301Z","modified":"2026-06-14T21:37:08.839Z","0.0.1":"2023-08-27T12:46:08.591Z","0.0.2":"2023-09-04T15:00:12.110Z","0.1.0":"2024-12-20T05:58:15.266Z","0.2.0":"2026-04-26T14:26:23.513Z","0.3.0":"2026-06-14T21:37:08.598Z"},"bugs":{"url":"https://github.com/JoshuaKGoldberg/cached-factory/issues"},"author":{"name":"joshuakgoldberg","email":"npm@joshuakgoldberg.com"},"license":"MIT","homepage":"https://github.com/JoshuaKGoldberg/cached-factory#readme","repository":{"type":"git","url":"git+https://github.com/JoshuaKGoldberg/cached-factory.git"},"description":"Creates and caches values under keys. 🏭","maintainers":[{"name":"joshuakgoldberg","email":"npm@joshuakgoldberg.com"}],"readme":"<h1 align=\"center\">cached-factory</h1>\n\n<p align=\"center\">\n\tCreates and caches values under keys.\n\t🏭\n</p>\n\n<p align=\"center\">\n\t<!-- prettier-ignore-start -->\n\t<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->\n\t<a href=\"#contributors\" target=\"_blank\"><img alt=\"👪 All Contributors: 2\" src=\"https://img.shields.io/badge/%F0%9F%91%AA_all_contributors-2-21bb42.svg\" /></a>\n<!-- ALL-CONTRIBUTORS-BADGE:END -->\n\t<!-- prettier-ignore-end -->\n\t<a href=\"https://github.com/JoshuaKGoldberg/cached-factory/blob/main/.github/CODE_OF_CONDUCT.md\" target=\"_blank\"><img alt=\"🤝 Code of Conduct: Kept\" src=\"https://img.shields.io/badge/%F0%9F%A4%9D_code_of_conduct-kept-21bb42\" /></a>\n\t<a href=\"https://codecov.io/gh/JoshuaKGoldberg/cached-factory\" target=\"_blank\"><img alt=\"🧪 Coverage\" src=\"https://img.shields.io/codecov/c/github/JoshuaKGoldberg/cached-factory?label=%F0%9F%A7%AA%20coverage\" /></a>\n\t<a href=\"https://github.com/JoshuaKGoldberg/cached-factory/blob/main/LICENSE.md\" target=\"_blank\"><img alt=\"📝 License: MIT\" src=\"https://img.shields.io/badge/%F0%9F%93%9D_license-MIT-21bb42.svg\" /></a>\n\t<a href=\"http://npmjs.com/package/cached-factory\" target=\"_blank\"><img alt=\"📦 npm version\" src=\"https://img.shields.io/npm/v/cached-factory?color=21bb42&label=%F0%9F%93%A6%20npm\" /></a>\n\t<img alt=\"💪 TypeScript: Strict\" src=\"https://img.shields.io/badge/%F0%9F%92%AA_typescript-strict-21bb42.svg\" />\n</p>\n\n## Usage\n\n### `CachedFactory`\n\n`cached-factory` exports a `CachedFactory` class that takes in \"factory\" function in its constructor.\nEach time a factory's `.get(key)` is called with any `key` for the first time, that factory is used to create a value under the `key`.\n\n```ts\nimport { CachedFactory } from \"cached-factory\";\n\nconst cache = new CachedFactory((key) => `Cached: ${key}!`);\n\n// \"Cached: apple!\"\ncache.get(\"apple\");\n```\n\nValues are cached so that subsequent `.get(key)` calls with the same `key` instantly return the same value.\n\n```ts\nimport { CachedFactory } from \"cached-factory\";\n\nconst cache = new CachedFactory((key) => ({ key }));\n\n// { key: \"banana\" }\ncache.get(\"banana\");\n\n// true\ncache.get(\"banana\") === cache.get(\"banana\");\n```\n\n### `WeakCachedFactory`\n\nThe package also exports a `WeakCachedFactory` class that provides the same behavior as `CachedFactory` but uses a `WeakMap` as its underlying data structure.\nAs such, only objects can be used for keys (no primitives), and there is no `entries()` function.\n\n```ts\nimport { WeakCachedFactory } from \"cached-factory\";\n\nconst cache = new WeakCachedFactory((key: Context) =>\n\tcreateSomeResultObject(key),\n);\n\nconst result = cache.get(someContext);\n\n// true\nresult === cache.get(someContext);\n```\n\n## Asynchronous Factories\n\n`CachedFactory` does not itself handle `Promise` logic, but it doesn't have to!\nProvided factory functions can themselves be `async` / return `Promise` values.\n\n```ts\nconst cache = new CachedFactory(\n\tasync (key) => await fetch(`/some/resource?key=${key}`),\n);\n\n// Type: Promise<Response>\ncache.get(\"cherry\");\n\n// Type: Response\nawait cache.get(\"cherry\");\n```\n\n### Other Methods\n\n#### `clear`\n\nClears the cache.\n\n```ts\ncache.clear();\n```\n\n### TypeScript\n\n`cached-factory` is written in TypeScript and ships with strong typing.\n💪\n\n> 👉 Tip: if you're working with [`noImplicitAny`](https://aka.ms/tsconfig#noImplicitAny) enabled _(which is generally a good idea)_, an inline function provided as an argument to `CachedFactory` may need an explicit type annotation for its key.\n>\n> ```ts\n> new CachedFactory((key: string) => `Cached: ${key}!`);\n> ```\n\n## Development\n\nSee [`.github/CONTRIBUTING.md`](./.github/CONTRIBUTING.md), then [`.github/DEVELOPMENT.md`](./.github/DEVELOPMENT.md).\nThanks! 🏭\n\n## Contributors\n\n<!-- spellchecker: disable -->\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore-start -->\n<table>\n  <tbody>\n    <tr>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"http://lishaduck.github.io\"><img src=\"https://avatars.githubusercontent.com/u/88557639?v=4?s=100\" width=\"100px;\" alt=\"Eli\"/><br /><sub><b>Eli</b></sub></a><br /><a href=\"https://github.com/JoshuaKGoldberg/cached-factory/issues?q=author%3Alishaduck\" title=\"Bug reports\">🐛</a></td>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"http://www.joshuakgoldberg.com/\"><img src=\"https://avatars.githubusercontent.com/u/3335181?v=4?s=100\" width=\"100px;\" alt=\"Josh Goldberg ✨\"/><br /><sub><b>Josh Goldberg ✨</b></sub></a><br /><a href=\"https://github.com/JoshuaKGoldberg/cached-factory/commits?author=JoshuaKGoldberg\" title=\"Code\">💻</a> <a href=\"#content-JoshuaKGoldberg\" title=\"Content\">🖋</a> <a href=\"https://github.com/JoshuaKGoldberg/cached-factory/commits?author=JoshuaKGoldberg\" title=\"Documentation\">📖</a> <a href=\"#ideas-JoshuaKGoldberg\" title=\"Ideas, Planning, & Feedback\">🤔</a> <a href=\"#infra-JoshuaKGoldberg\" title=\"Infrastructure (Hosting, Build-Tools, etc)\">🚇</a> <a href=\"#maintenance-JoshuaKGoldberg\" title=\"Maintenance\">🚧</a> <a href=\"#projectManagement-JoshuaKGoldberg\" title=\"Project Management\">📆</a> <a href=\"#tool-JoshuaKGoldberg\" title=\"Tools\">🔧</a></td>\n    </tr>\n  </tbody>\n</table>\n\n<!-- prettier-ignore-end -->\n\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n<!-- spellchecker: enable -->\n\n> 💝 This package was templated with [`create-typescript-app`](https://github.com/JoshuaKGoldberg/create-typescript-app) using the [Bingo framework](https://create.bingo).\n","readmeFilename":"README.md"}