{"id":17930532,"url":"https://github.com/lovasoa/memoization","last_synced_at":"2025-03-24T04:31:20.042Z","repository":{"id":57294461,"uuid":"48072549","full_name":"lovasoa/memoization","owner":"lovasoa","description":"Straightforward implementation of memoization in javascript","archived":false,"fork":false,"pushed_at":"2016-11-02T14:15:39.000Z","size":6,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-19T02:00:01.720Z","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":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lovasoa.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":"2015-12-15T22:24:55.000Z","updated_at":"2020-12-06T18:49:47.000Z","dependencies_parsed_at":"2022-08-29T08:01:47.294Z","dependency_job_id":null,"html_url":"https://github.com/lovasoa/memoization","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovasoa%2Fmemoization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovasoa%2Fmemoization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovasoa%2Fmemoization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovasoa%2Fmemoization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lovasoa","download_url":"https://codeload.github.com/lovasoa/memoization/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245211084,"owners_count":20578341,"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-10-28T21:14:00.255Z","updated_at":"2025-03-24T04:31:19.759Z","avatar_url":"https://github.com/lovasoa.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/lovasoa/memoization.svg?branch=master)](https://travis-ci.org/lovasoa/memoization)\n# memoization\nStraightforward implementation of memoization in javascript\n\n## Exemple Usage\n```js\nvar memoize = require(\"memoization\");\nvar fib = memoize(function(n){return n\u003c2 ? n : fib(n-1) + fib(n-2);});\n```\n\n## Code\n```js\nfunction memoize(f) {\n  var dict = {};\n  return function() {\n    var args = JSON.stringify(arguments);\n    if(dict.hasOwnProperty(args)) return dict[args];\n    var res = f.apply(this, arguments);\n    dict[args] = res;\n    return res;\n  }\n}\n\nif (typeof module === \"object\") module.exports = memoize;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flovasoa%2Fmemoization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flovasoa%2Fmemoization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flovasoa%2Fmemoization/lists"}