{"id":18358854,"url":"https://github.com/uppercod/cache","last_synced_at":"2025-04-10T03:05:41.475Z","repository":{"id":113250513,"uuid":"288368772","full_name":"UpperCod/cache","owner":"UpperCod","description":null,"archived":false,"fork":false,"pushed_at":"2020-09-22T03:28:43.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-25T02:42:34.075Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/UpperCod.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-18T06:00:57.000Z","updated_at":"2020-09-22T03:28:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"ebdec912-8101-437a-bf07-7a3e3b3b1a57","html_url":"https://github.com/UpperCod/cache","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"UpperCod/pkg-base","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpperCod%2Fcache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpperCod%2Fcache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpperCod%2Fcache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UpperCod%2Fcache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UpperCod","download_url":"https://codeload.github.com/UpperCod/cache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239036195,"owners_count":19571459,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T22:19:44.394Z","updated_at":"2025-02-15T18:30:06.036Z","avatar_url":"https://github.com/UpperCod.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cache\n\nThis script creates an in-memory cache that allows:\n\n1. The callback execution when regenerating the arguments.\n2. Use references to return arguments.\n\n## install\n\n```\nnpm install cache\n```\n\n## Usage\n\nSuppose that part was a high-cost process, such as template rendering or an asynchronous call.\n\n```js\nimport createCache from \"@uppercod/cache\";\n\nconst cache = createCache();\n\nfunction parse(code = \"\") {\n    return code.split(/ */);\n}\n/**\n * the Cache function will only memorize the first execution, since there is no second parameter.\n */\nconst value1 = cache(parse);\n/**\n * The cache function will memorize the execution of the function based on the second parameter.\n **/\nconst value2 = cache(parse, \"my-code\");\n/**\n * The cache function memorizes the execution of the function based on the arguments of the second parameter.\n **/\nconst value3 = cache(parse, [\"my-code\"]);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuppercod%2Fcache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuppercod%2Fcache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuppercod%2Fcache/lists"}