{"id":19756277,"url":"https://github.com/nextapps-de/flexicache","last_synced_at":"2026-03-14T00:03:45.177Z","repository":{"id":57238302,"uuid":"123971509","full_name":"nextapps-de/flexicache","owner":"nextapps-de","description":null,"archived":false,"fork":false,"pushed_at":"2018-03-14T12:04:50.000Z","size":34,"stargazers_count":11,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-14T06:04:23.466Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nextapps-de.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":"2018-03-05T19:59:30.000Z","updated_at":"2025-02-11T15:50:17.000Z","dependencies_parsed_at":"2022-08-26T15:01:50.395Z","dependency_job_id":null,"html_url":"https://github.com/nextapps-de/flexicache","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/nextapps-de%2Fflexicache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextapps-de%2Fflexicache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextapps-de%2Fflexicache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextapps-de%2Fflexicache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nextapps-de","download_url":"https://codeload.github.com/nextapps-de/flexicache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251691610,"owners_count":21628356,"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":[],"created_at":"2024-11-12T03:15:25.085Z","updated_at":"2026-03-14T00:03:45.055Z","avatar_url":"https://github.com/nextapps-de.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FlexiCache\n\n### Lightweight auto-balancing cache handler with zero dependencies.\n\nFlexiCache automatically balance caches by expiration time, frequency of data accesses, access timeout, maximum stack size and/or memory limit. \n\nSupported Platforms:\n- Browser\n- Node.js\n\nSupported Module Definitions:\n- AMD (RequireJS, Xone)\n- CommonJS (Node.js)\n- Closure (Xone)\n- Global (window)\n\nAll Features:\n\u003cul\u003e\n    \u003cli\u003eAuto-cleanup cache by:\u003cul\u003e\n        \u003cli\u003eExpiration time\u003c/li\u003e\n        \u003cli\u003eFrequency of data accesses\u003c/li\u003e\n        \u003cli\u003eAccess timeout\u003c/li\u003e\n        \u003cli\u003eMaximum size (stack)\u003c/li\u003e\n        \u003cli\u003eMemory limit\u003c/li\u003e\n    \u003c/ul\u003e\u003c/li\u003e\n    \u003cli\u003eAllows free combination of all the above options\u003c/li\u003e\n    \u003cli\u003eDebug infos \u0026 statistics\u003c/li\u003e\n    \u003cli\u003eSave / Load dump\u003c/li\u003e\n\u003c/ul\u003e\n\nOptional Plugins: (actually unreleased)\n\u003cul\u003e\n    \u003cli\u003eRedis API Adapter\u003c/li\u003e\n    \u003cli\u003eFilesystem Plugin (HTML5)\u003c/li\u003e\n    \u003cli\u003eFilesystem Plugin (Node.js)\u003c/li\u003e\n    \u003cli\u003eLocalStorage Plugin (HTML5)\u003c/li\u003e\n\u003c/ul\u003e\n\n## Installation\n\n##### HTML / Javascript\n\n```html\n\u003chtml\u003e\n\u003chead\u003e\n    \u003cscript src=\"https://cdn.rawgit.com/nextapps-de/flexicache/master/flexicache.min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n...\n```\n\n##### Node.js\n\n```npm\nnpm install flexicache\n```\n\nIn your code include as follows:\n\n```javascript\nvar FlexiCache = require(\"flexicache\");\n```\n\nOr pass in options when requiring:\n\n```javascript\nvar cache = require(\"flexicache\").create({/* options */});\n```\n\n__AMD__\n\n```javascript\nvar FlexiCache = require(\"./flexicache.js\");\n```\n\n## Usage (API)\n\n#### Create a new cache\n\n```js\nvar cache = new FlexiCache();\n```\n\nalternatively you can also use:\n\n```js\nvar cache = FlexiCache.create();\n```\n\n##### Create a new cache with custom options\n\n\u003e FlexiCache.__create__(options)\n\n```js\nvar cache = new FlexiCache({\n\n    // default values:\n\n    expire: 60 * 60 * 1000, // 1 hour\n    size: 1000,\n    auto: true,\n    timeout: false,\n    memory: false\n});\n```\n\n#### Add items to a cache\n\n\u003e Cache.__add___(id, *)\n\n```js\ncache.add(10000, 'foo');\n```\nadd more complex objects:\n```js\ncache.add(10025, {\n    \n    id: 10025,\n    name: 'foo'\n});\n```\nclone and add objects:\n```js\ncache.add(10025, {\n    \n    id: 10025,\n    name: 'foo'\n    \n}, true);\n```\n\n#### Update item of the cache\n\n\u003e Cache.__update__(id, *)\n\n```js\ncache.update(10000, 'bar');\n```\nclone and update objects:\n```js\ncache.update(10025, {\n    \n    id: 10025,\n    name: 'foo'\n    \n}, true);\n```\n\n#### Remove item to the cache\n\n\u003e Cache.__remove__(id)\n\n```js\ncache.remove(10025);\n```\n\n#### Destroy the cache\n\n```js\ncache.destroy();\n```\n\n#### Initialize the cache\n\n\u003e Cache.__init__(options)\n\n```js\ncache.init();\n```\n\n#### Get info\n\n```js\ncache.info();\n```\n\nReturns information about the cache, e.g.:\n\n```json\n{\n    \"bytes\": 3600356288,\n    \"id\": 0,\n    \"auto\": false,\n    \"expire\": 3600,\n    \"size\": 10000,\n    \"status\": false\n}\n```\n\n#### Optimize / Cleanup cache\n\n```js\ncache.cleanup();\n```\n\n---\nAuthor FlexiCache: Thomas Wilkerling\u003cbr\u003e\nLicense: \u003ca href=\"http://www.apache.org/licenses/LICENSE-2.0.html\" target=\"_blank\"\u003eApache 2.0 License\u003c/a\u003e\u003cbr\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextapps-de%2Fflexicache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnextapps-de%2Fflexicache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextapps-de%2Fflexicache/lists"}