{"id":30060346,"url":"https://github.com/tiaanduplessis/react-native-modest-cache","last_synced_at":"2025-08-08T01:44:08.132Z","repository":{"id":57338442,"uuid":"88308194","full_name":"tiaanduplessis/react-native-modest-cache","owner":"tiaanduplessis","description":"💾 Simple cache for AsyncStorage","archived":false,"fork":false,"pushed_at":"2019-11-17T09:00:11.000Z","size":156,"stargazers_count":23,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-09T01:38:35.902Z","etag":null,"topics":["async-storage","cache","react-native","storage"],"latest_commit_sha":null,"homepage":null,"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/tiaanduplessis.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":"2017-04-14T22:35:53.000Z","updated_at":"2022-05-30T09:48:06.000Z","dependencies_parsed_at":"2022-09-07T11:50:47.482Z","dependency_job_id":null,"html_url":"https://github.com/tiaanduplessis/react-native-modest-cache","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/tiaanduplessis/react-native-modest-cache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Freact-native-modest-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Freact-native-modest-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Freact-native-modest-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Freact-native-modest-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tiaanduplessis","download_url":"https://codeload.github.com/tiaanduplessis/react-native-modest-cache/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiaanduplessis%2Freact-native-modest-cache/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269352228,"owners_count":24402672,"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-08-07T02:00:09.698Z","response_time":73,"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":["async-storage","cache","react-native","storage"],"created_at":"2025-08-08T01:43:59.552Z","updated_at":"2025-08-08T01:44:08.088Z","avatar_url":"https://github.com/tiaanduplessis.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e💾 react-native-modest-cache\u003c/h1\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cstrong\u003eSimple cache wrapper for AsyncStorage\u003c/strong\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://npmjs.org/package/react-native-modest-cache\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/react-native-modest-cache.svg?style=flat-square\" alt=\"Package version\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://npmjs.org/package/react-native-modest-cache\"\u003e\n  \u003cimg src=\"https://img.shields.io/npm/dm/react-native-modest-cache.svg?style=flat-square\" alt=\"Downloads\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/feross/standard\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square\" alt=\"Standard\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://travis-ci.org/tiaanduplessis/react-native-modest-cache\"\u003e\n    \u003cimg src=\"https://img.shields.io/travis/tiaanduplessis/react-native-modest-cache.svg?style=flat-square\" alt=\"Travis Build\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/RichardLitt/standard-readme)\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square\" alt=\"Standard Readme\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/tiaanduplessis/react-native-modest-cache/blob/master/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/l/react-native-modest-cache.svg?style=flat-square\" alt=\"License\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"http://makeapullrequest.com\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square\" alt=\"PRs\" /\u003e\n  \u003c/a\u003e\n\t  \u003ca href=\"https://greenkeeper.io/\"\u003e\n    \u003cimg src=\"https://badges.greenkeeper.io/tiaanduplessis/react-native-modest-cache.svg\" alt=\"Greenkeeper\" /\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n\u003ch2\u003eTable of Contents\u003c/h2\u003e\n\u003cdetails\u003e\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\n  \u003cli\u003e\u003ca href=\"#about\"\u003eAbout\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca href=\"#install\"\u003eInstall\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca href=\"#contribute\"\u003eContribute\u003c/a\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\n\u003c/details\u003e\n\n## About\n\nThis module is a wrapper around [react-native-modest-storage](https://github.com/tiaanduplessis/react-native-modest-storage) that extends it for handling cached values.\n\n## Install\n\n```sh\n$ npm install --save react-native-modest-cache\n# OR\n$ yarn add react-native-modest-cache\n```\n\n## Usage\n\n```js\nimport cache from 'react-native-modest-cache'\n\ncache.set('foo', 5, -5) // (key, value, expiryDateInMinutes)\ncache.set('bar', 90) // Default to 60 min\ncache.set('baz', {hello: 'Friend'})\ncache.isExpired('foo').then(console.log) // true\ncache.isExpired('bar').then(console.log) // false\ncache.get('foo').then(console.log) // undefined\ncache.get('bar').then(console.log) // 90\ncache.get('baz').then(console.log) // Object {hello: \"Friend\"}\n\ncache.remove('bar')\ncache.get('bar').then(console.log) // undefined\n\ncache.set('bar', 50, {\n\tinterval: 'year', // 'year', 'quarter', 'month', 'week', 'day', 'minute' or 'second'\n\tunits: 2\n})\ncache.isExpired('bar').then(console.log) // false\ncache.get('bar').then(console.log) // 50\n\ncache.flushExpired()\ncache.flush().then(() =\u003e {\n\tcache.get('bar').then(console.log) // undefined\n})\n```\n\n## Contribute\n\nContributions are welcome. Please open up an issue or create PR if you would like to help out.\n\n## License\n\nLicensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiaanduplessis%2Freact-native-modest-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiaanduplessis%2Freact-native-modest-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiaanduplessis%2Freact-native-modest-cache/lists"}