{"id":16370197,"url":"https://github.com/cyan33/memoize","last_synced_at":"2025-06-12T13:36:39.263Z","repository":{"id":57101204,"uuid":"107450625","full_name":"cyan33/memoize","owner":"cyan33","description":"A JavaScript function wrapper to memorize / cache result with the same input","archived":false,"fork":false,"pushed_at":"2017-10-28T21:04:47.000Z","size":4,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-11T02:19:30.100Z","etag":null,"topics":["cache","funcional-programming","wrapper"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cyan33.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-18T19:00:42.000Z","updated_at":"2017-11-16T12:15:38.000Z","dependencies_parsed_at":"2022-08-20T16:20:52.142Z","dependency_job_id":null,"html_url":"https://github.com/cyan33/memoize","commit_stats":null,"previous_names":["thomasyimgit/memoize"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyan33%2Fmemoize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyan33%2Fmemoize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyan33%2Fmemoize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyan33%2Fmemoize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyan33","download_url":"https://codeload.github.com/cyan33/memoize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238218426,"owners_count":19435847,"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":["cache","funcional-programming","wrapper"],"created_at":"2024-10-11T03:04:18.758Z","updated_at":"2025-02-11T11:31:50.948Z","avatar_url":"https://github.com/cyan33.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# memoize\n:beginner: A JavaScript function wrapper to memorize / cache result with the same input\n\n# Installation\n\n```\nnpm install --save @changyan/memoize\n```\n\n# Basic Usage\n\n```js\nimport { memoize, memoizeAsync } from '@changyan/memoize'\n\nconst add = (a, b) =\u003e a + b\n\nconst memoizedAdd = memoize(add)\n\nmemoizedAdd(1, 2) // =\u003e 3\nmemoizedAdd(1, 2) // =\u003e return the cached \"3\"\n\nconst getFakeAsyncResult = () =\u003e new Promise((resolve, reject) =\u003e setTimeout(resolve, 1000))\n\n// and it supports caching async functions\nconst memoizedGetAsyncResult = memoizeAsync(getFakeAsyncResult)\n```\n\n## Contribution\n\nPRs are welcomed!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyan33%2Fmemoize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyan33%2Fmemoize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyan33%2Fmemoize/lists"}