{"id":18450867,"url":"https://github.com/patrixr/tronicache","last_synced_at":"2025-10-26T19:13:58.485Z","repository":{"id":57380100,"uuid":"217192836","full_name":"patrixr/tronicache","owner":"patrixr","description":"An opinionated memcache","archived":false,"fork":false,"pushed_at":"2023-03-03T08:26:16.000Z","size":41,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T10:56:53.288Z","etag":null,"topics":["cache","concept","design-pattern","functional","hacktoberfest","javascript","memcache"],"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/patrixr.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-24T02:18:01.000Z","updated_at":"2020-10-09T04:20:04.000Z","dependencies_parsed_at":"2024-11-06T07:29:37.044Z","dependency_job_id":"09b88c35-c578-4057-9729-f97b8b24f6a9","html_url":"https://github.com/patrixr/tronicache","commit_stats":{"total_commits":6,"total_committers":2,"mean_commits":3.0,"dds":"0.16666666666666663","last_synced_commit":"f68a0dd0bb066df681295e4e6f277bd5c0e47e1f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrixr%2Ftronicache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrixr%2Ftronicache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrixr%2Ftronicache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrixr%2Ftronicache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patrixr","download_url":"https://codeload.github.com/patrixr/tronicache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249707823,"owners_count":21313933,"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","concept","design-pattern","functional","hacktoberfest","javascript","memcache"],"created_at":"2024-11-06T07:26:46.937Z","updated_at":"2025-10-26T19:13:53.431Z","avatar_url":"https://github.com/patrixr.png","language":"JavaScript","readme":"# Tronicache\n\n[![forthebadge](https://forthebadge.com/images/badges/made-with-javascript.svg)](https://forthebadge.com)\n\nAn argument-aware opinionated memcache\n\n# Installation\n\n```bash\nnpm install --save tronicache\n```\n\n# Usage\n\n## Create a cached service\n\n### Indefinite caching by default\n\n```javascript\nconst { cached } = require('tronicache');\n\nconst service = cached({\n  getUser(uid) {\n    // cached indefinitely\n  }\n})\n```\n\n### Configurable timeout\n\n```javascript\nconst { cached } = require('tronicache');\n\nconst service = cached({\n  timeout: 2 * 60 * 6000, // all methods at the root are cached for 2 minutes\n\n  getUser(uid) {\n    // cached for 2 minutes\n  }\n})\n```\n\n### Nested namespace support\n\n```javascript\nconst { cached } = require('tronicache');\n\nconst service = cached({\n  users: {\n    getUser(uid) {\n      // cached indefinitely\n    },\n\n    posts: {\n      // all methods within 'posts' will be cached for 2 minutes\n      timeout: 2 * 60 * 1000,\n      postsOfUser(uid) {\n        const user = this.users.getUser(uid); // notice the scope\n        // ...\n      }\n    }\n  },\n  notifications: {\n    // nothing under 'notifications' is cached\n    cache: false,\n    fetch() {\n      // ...\n    },\n\n    archive: {\n      cache: true, // override in the subnamespace\n      fetch() { }\n    }\n  }\n});\n\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrixr%2Ftronicache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrixr%2Ftronicache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrixr%2Ftronicache/lists"}