{"id":15293172,"url":"https://github.com/thekeenant/mocha","last_synced_at":"2025-04-13T12:34:42.578Z","repository":{"id":56834814,"uuid":"91849936","full_name":"thekeenant/mocha","owner":"thekeenant","description":":coffee: A caching library for Dart inspired by Guava.","archived":false,"fork":false,"pushed_at":"2019-08-28T01:23:11.000Z","size":8,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T03:35:18.330Z","etag":null,"topics":["cache","dart","dartlang","library"],"latest_commit_sha":null,"homepage":"","language":"Dart","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/thekeenant.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-05-19T22:27:20.000Z","updated_at":"2020-08-07T04:50:49.000Z","dependencies_parsed_at":"2022-09-02T03:50:44.214Z","dependency_job_id":null,"html_url":"https://github.com/thekeenant/mocha","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/thekeenant%2Fmocha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thekeenant%2Fmocha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thekeenant%2Fmocha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thekeenant%2Fmocha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thekeenant","download_url":"https://codeload.github.com/thekeenant/mocha/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248714755,"owners_count":21149961,"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","dart","dartlang","library"],"created_at":"2024-09-30T16:40:04.142Z","updated_at":"2025-04-13T12:34:42.554Z","avatar_url":"https://github.com/thekeenant.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mocha\n\nMocha is a simple caching library for Dart.\n\nFeatures\n\n* Size-based eviction\n* Time-based expiration (since last write)\n* Asynchronously refresh values\n* Automatic asynchronous loading of values into the cache\n* Manually...\n  * Evict/invalidate values\n  * Populate the cache\n\n\n## Usage\n\nA simple usage example:\n\n```dart\nimport 'dart:async';\nimport 'package:mocha/mocha.dart';\n\nFuture\u003cString\u003e expensiveOperation(int key) async {\n  // pretend this is takes time to calculate\n  var sq = key * key;\n  return '$key^2 = $sq';\n}\n\nmain() async {\n  var cache = new LoadingCache\u003cint, String\u003e(\n    expensiveOperation,\n    maximumSize: 10,\n    expiresAfterWrite: const Duration(minutes: 1)\n  );\n\n  print(await cache.get(4));\n}\n```\n\n## Features and bugs\n\nPlease file feature requests and bugs at the [issue tracker][tracker].\n\n[tracker]: https://github.com/thekeenant/mocha\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthekeenant%2Fmocha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthekeenant%2Fmocha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthekeenant%2Fmocha/lists"}