{"id":20336793,"url":"https://github.com/isaachinman/fs-memoize","last_synced_at":"2026-04-20T04:31:20.467Z","repository":{"id":57242286,"uuid":"377939828","full_name":"isaachinman/fs-memoize","owner":"isaachinman","description":"A simple, zero-dependency NodeJs filesystem memoizer.","archived":false,"fork":false,"pushed_at":"2021-06-20T12:30:56.000Z","size":71,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-14T17:20:05.603Z","etag":null,"topics":["cache","memoization","memoize","nodejs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/isaachinman.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}},"created_at":"2021-06-17T19:25:19.000Z","updated_at":"2022-04-13T16:05:09.000Z","dependencies_parsed_at":"2022-09-08T00:40:53.356Z","dependency_job_id":null,"html_url":"https://github.com/isaachinman/fs-memoize","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/isaachinman%2Ffs-memoize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaachinman%2Ffs-memoize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaachinman%2Ffs-memoize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaachinman%2Ffs-memoize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/isaachinman","download_url":"https://codeload.github.com/isaachinman/fs-memoize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241859792,"owners_count":20032318,"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","memoization","memoize","nodejs"],"created_at":"2024-11-14T21:06:51.515Z","updated_at":"2026-04-20T04:31:15.431Z","avatar_url":"https://github.com/isaachinman.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fs-memoize\n\n[![npm version](https://badge.fury.io/js/fs-memoize.svg)](https://badge.fury.io/js/fs-memoize)\n[![CircleCI](https://circleci.com/gh/isaachinman/fs-memoize.svg?style=shield)](https://circleci.com/gh/isaachinman/fs-memoize)\n\n**A simple, zero-dependency NodeJs filesystem memoizer.**\n\n### Installation\n\n```\nyarn install fs-memoize\n```\n\n### Usage\n\n```tsx\nimport { fsMemoize } from 'fs-memoize'\n\nconst myExpensiveFunction = async () =\u003e {\n  // ...Does expensive stuff\n}\n\nconst myExpensiveFunctionCached = fsMemoize(\n  myExpensiveFunction,\n  {\n    cacheBaseName: 'myExpensiveFunction',\n    ttl: 60 * 1000,\n  }\n)\n\n```\n\n### How it works\n\nThe `fsMemoize` function will return back a memoized version of your async function.\n\nA cache key is generated based on `cacheBaseKey` + all function arguments, stringified.\n\nCache life is controlled via the `ttl` config option, in milliseconds.\n\nData, by default, is stored in `/tmp/fs-memoize`, but the location can be changed via the optional `cacheDir` config option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisaachinman%2Ffs-memoize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisaachinman%2Ffs-memoize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisaachinman%2Ffs-memoize/lists"}