{"id":18382195,"url":"https://github.com/shanev/tempdb","last_synced_at":"2025-04-06T23:31:30.681Z","repository":{"id":66460486,"uuid":"84496444","full_name":"shanev/tempdb","owner":"shanev","description":"Redis-backed ephemeral key-value store for Node","archived":false,"fork":false,"pushed_at":"2017-11-06T06:57:36.000Z","size":54,"stargazers_count":29,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-23T23:15:28.022Z","etag":null,"topics":["async-await","es6","javascript","key-value","node","nodejs","redis"],"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/shanev.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":"2017-03-09T22:56:37.000Z","updated_at":"2024-03-29T05:56:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"e8f32037-5d76-46cb-b13d-5978ad9e06c6","html_url":"https://github.com/shanev/tempdb","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/shanev%2Ftempdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shanev%2Ftempdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shanev%2Ftempdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shanev%2Ftempdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shanev","download_url":"https://codeload.github.com/shanev/tempdb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247569123,"owners_count":20959758,"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":["async-await","es6","javascript","key-value","node","nodejs","redis"],"created_at":"2024-11-06T01:03:38.945Z","updated_at":"2025-04-06T23:31:30.675Z","avatar_url":"https://github.com/shanev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TempDB\n\n[![npm version](https://badge.fury.io/js/tempdb.svg)](https://badge.fury.io/js/tempdb)\n[![Build Status](https://travis-ci.org/shanev/tempdb.svg?branch=master)](https://travis-ci.org/shanev/tempdb)\n[![codecov](https://codecov.io/gh/shanev/tempdb/branch/master/graph/badge.svg)](https://codecov.io/gh/shanev/tempdb)\n[![codebeat badge](https://codebeat.co/badges/c614ab13-0067-4bec-b4af-7683d01d0434)](https://codebeat.co/projects/github-com-shanev-tempdb-master)\n[![Dependencies](https://david-dm.org/shanev/tempdb.svg)](https://david-dm.org/shanev/tempdb)\n\nTempDB is Redis-backed temporary key-value store for Node. It's useful for storing temporary data such as login codes, authentication tokens, and temporary passwords.\n\n## Installation\n\n```sh\nnpm install tempdb\n```\n\n### Run Redis server\n\nCheck out [Redis quickstart](https://redis.io/topics/quickstart) to install for your platform, or use one of the many cloud providers. Depending on your Redis provider, you may need to enable keyspace events for ephemeral keys to work.\n\nA convenience script is provided for macOS default Homebrew Redis installs:\n\n```sh\nnpm run redis\n```\n\n## Usage\n\nRequire TempDB:\n```js\nconst TempDB = require('tempdb');\n```\n\nInitialize TempDB, connecting to a [Redis client](https://github.com/NodeRedis/node_redis):\n```js\nconst tempDB = new TempDB(redisClient);\n```\n\nAdd a key/value pair. Value is anything that can be serialized to JSON. Expires (in seconds) is optional.\n```js\ntempDB.add('key', value, expires);\n```\n\nFind by key:\n```js\nconst value = await tempDB.find('key');\n```\n\nFind and delete by key:\n```js\nconst value = await tempDB.findAndDelete('key');\n```\n\n## Tests\n\n```sh\nnpm install\nnpm test\n```\n\n## Ports to other languages\n\n* Go: [https://github.com/rafaeljesus/tempdb](https://github.com/rafaeljesus/tempdb)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshanev%2Ftempdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshanev%2Ftempdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshanev%2Ftempdb/lists"}