{"id":17668651,"url":"https://github.com/evanshortiss/expeditious-engine-memory","last_synced_at":"2025-03-30T13:23:58.354Z","repository":{"id":66153833,"uuid":"62477882","full_name":"evanshortiss/expeditious-engine-memory","owner":"evanshortiss","description":"storage engine for expeditious that uses node.js process memory","archived":false,"fork":false,"pushed_at":"2020-05-12T15:40:33.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-05T15:13:59.446Z","etag":null,"topics":["cache-engine","engine","expeditious","memory","memory-engine"],"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/evanshortiss.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2016-07-03T02:22:03.000Z","updated_at":"2017-10-18T23:13:06.000Z","dependencies_parsed_at":"2023-04-20T11:58:06.239Z","dependency_job_id":null,"html_url":"https://github.com/evanshortiss/expeditious-engine-memory","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanshortiss%2Fexpeditious-engine-memory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanshortiss%2Fexpeditious-engine-memory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanshortiss%2Fexpeditious-engine-memory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evanshortiss%2Fexpeditious-engine-memory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evanshortiss","download_url":"https://codeload.github.com/evanshortiss/expeditious-engine-memory/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246321575,"owners_count":20758664,"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-engine","engine","expeditious","memory","memory-engine"],"created_at":"2024-10-23T23:23:20.318Z","updated_at":"2025-03-30T13:23:58.327Z","avatar_url":"https://github.com/evanshortiss.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"expeditious-engine-memory\n=========================\n[![Circle CI](https://circleci.com/gh/evanshortiss/expeditious-engine-memory/tree/master.svg?style=svg)](https://circleci.com/gh/evanshortiss/expeditious-engine-memory/tree/master)\n\nAn in memory engine for expeditious. Cache entries are - you guessed it -\nstored in the node.js process memory. This cache engine will lose everything\nstored if your process restarts, and could lead to memory bloat and slow\ngarbage collections if you're not careful with the size and volume of entries!\n\n## Usage\nYou can use this module standalone or with expeditious which is the\nrecommended approach since it simplifies interactions and allows you to easily\nswitch cache engines.\n\n```js\nvar expeditious = require('expeditious');\n\nvar countries = expeditious({\n  // Use the expeditious memory engine\n  engine: require('expeditious-engine-memory')(),\n  // Prefix all entries with 'countries'\n  namespace: 'countries',\n  // Auto parse json entries\n  objectMode: true,\n  // 1 hour timeout for entries\n  defaultTtl: (60 * 1000 * 60),\n});\n\ncountries.set({\n  key: 'ireland',\n  value: {\n    population: '4.595 million',\n    capital: 'Dublin'\n  }\n}, function (err) {\n  if (!err) {\n    console.error('failed to add \"ireland\" to the cache');\n  } else {\n    console.log('add \"ireland\" to the cache');\n  }\n});\n```\n\n## API\nEach API function takes a callback function as the last parameter and it\nreceives up to two arguments as per node.js convention, error _err_ and an\noptional result, _res_.\n\n#### set(key, value, expire, callback)\nSet a _key_ (String) in the cache with a given (String) _value_. _expire_ must\nbe a Number greater than 0.\n\n#### get(key, callback)\nGet a specific item from the cache. Returns _null_ if the entry is\nnot found.\n\n#### del(key, callback)\nDelete a specific item from the cache. Callback receives only an error\nparameter.\n\n#### keys(callback)\nList all keys that this engine instance contains.\n\n#### ttl(key, callback)\nGet the time left before _key_ expires. Returns _null_ as _res_ if the entry is\nnot found.\n\n#### flush(callback)\nFlush all items from the engine instance.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevanshortiss%2Fexpeditious-engine-memory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevanshortiss%2Fexpeditious-engine-memory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevanshortiss%2Fexpeditious-engine-memory/lists"}