{"id":28541743,"url":"https://github.com/rjsaran/multicache","last_synced_at":"2025-10-14T10:06:21.646Z","repository":{"id":101573066,"uuid":"109433355","full_name":"rjsaran/multicache","owner":"rjsaran","description":"Multiple object cache for NodeJS","archived":false,"fork":false,"pushed_at":"2020-01-23T07:22:47.000Z","size":13,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-09T20:09:47.526Z","etag":null,"topics":["cache","nodejs","object-cache"],"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/rjsaran.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,"zenodo":null}},"created_at":"2017-11-03T19:09:42.000Z","updated_at":"2024-07-17T10:24:37.000Z","dependencies_parsed_at":"2023-06-05T21:15:37.484Z","dependency_job_id":null,"html_url":"https://github.com/rjsaran/multicache","commit_stats":{"total_commits":12,"total_committers":3,"mean_commits":4.0,"dds":"0.41666666666666663","last_synced_commit":"b4eca69ca0cf4c105663b4aeddfbc42548f6443f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rjsaran/multicache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjsaran%2Fmulticache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjsaran%2Fmulticache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjsaran%2Fmulticache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjsaran%2Fmulticache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rjsaran","download_url":"https://codeload.github.com/rjsaran/multicache/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjsaran%2Fmulticache/sbom","scorecard":{"id":778069,"data":{"date":"2025-08-11","repo":{"name":"github.com/rjsaran/multicache","commit":"b4eca69ca0cf4c105663b4aeddfbc42548f6443f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/12 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-23T04:09:22.464Z","repository_id":101573066,"created_at":"2025-08-23T04:09:22.464Z","updated_at":"2025-08-23T04:09:22.464Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018713,"owners_count":26086449,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","nodejs","object-cache"],"created_at":"2025-06-09T20:09:46.597Z","updated_at":"2025-10-14T10:06:21.641Z","avatar_url":"https://github.com/rjsaran.png","language":"JavaScript","readme":"MultiCache\n=======\n\nMultiCache is an Multiple Object caching module for node.js. Objects are cached via a backing store.\n\n(Inspired by [obcache](https://github.com/qzaidi/obcache))\n\nCurrently 2 stores are supported.\n\n - Memory\n - Redis\n \n Multicache First check for each item in cache parallely, Than do only one single call to fetch data from underlying datastore for which no data is present in cache. Respond with data from both Cache and Main data store merged.\n\n\n Usage\n -----\n \n ```\n const Cache = require('./lib/cache');\n \n // Create a Redis cache\n const cache = new Cache('redis', {port: 6379, host: '127.0.0.1'});\n ```\n \n To cache response of a function:\n 1) Wrap original function like below\n ```\n var wrapper = cache.wrap(original);\n ```\n 2) Now call the wrapped function\n ```\n wrapper(arg1,arg2...argn,function(err,res) {\n   if (!err) {\n      // do something with res\n   }\n });\n ```\n \n API\n---\n\n ### cache.wrap \n Wraps a given function and returns a cached version of it.\n Functions to be wrapped must have a callback function as the last argument. The callback function is expected to recieve 2 arguments - err and data. data gets stored in the cache.\n\n The first n-1 arguments are used to create the key. Subsequently, when the wrapped function is called with the same n arguments, it would lookup the key in cache, and if found, call the callback with the associated data.\n \nNotes: \nIn case of memory store, It is expected that the callback will never modified the returned data, as any modifications of the original will change the object in cache.\n\nLets Say input ids are : [123, 143];\n\nResponse of orignal function should always be:\n```\n{\n  123: {},\n  143: {}\n}\n```\n\nMemory Store:\n\n| Key           | Type          | Description            |\n|:-------------:|:-------------:| :---------------------:|\n| max           | Integer       | Maximum no of keys in LRU store|\n| maxAge        | Integer       | TTL in miliseconds     |\n\nRedis Store:\n\n| Key           | Type          | Description            | Default |\n|:-------------:|:-------------:| :---------------------:|:--------:|\n| maxAge        | Integer       | TTL in miliseconds             | 60 Seconds|\n| db            | Integer       | Redis Server DB                | 0         |\n| prefix        | String        | Prefix to be used for redis key| mbc:      |\n| twemproxy     | Boolean       | Redis server is behind twemproxy or not| false |\n| host          | String        | Redis Host                     | 127.0.0.1 |\n| port          | Integer       | Redis Port                     | 6379 |\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frjsaran%2Fmulticache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frjsaran%2Fmulticache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frjsaran%2Fmulticache/lists"}