{"id":46184,"library":"redis-typescript","title":"Tedis","description":"Tedis is a TypeScript-based Redis client for Node.js, supporting async/await with full TypeScript definitions. Version 0.1.2 (latest) offers both ESM and CJS support with a promise-based API. It provides a connection pool (TedisPool) and direct commands via Tedis.command(). Compared to ioredis, it is simpler and more lightweight, but lacks cluster support and advanced features. Development appears to be in early stages with low release cadence.","status":"active","version":"0.1.2","language":"javascript","source_language":"en","source_url":"https://github.com/myour-cc/tedis","tags":["javascript","tedis","redis","typescript","async","await","promise"],"install":[{"cmd":"npm install redis-typescript","lang":"bash","label":"npm"},{"cmd":"yarn add redis-typescript","lang":"bash","label":"yarn"},{"cmd":"pnpm add redis-typescript","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM import is the preferred pattern; CJS also exports Tedis as a named export.","wrong":"const Tedis = require('tedis').Tedis","symbol":"Tedis","correct":"import { Tedis } from 'tedis'"},{"note":"TedisPool is a named export, not a default export.","wrong":"import TedisPool from 'tedis'","symbol":"TedisPool","correct":"import { TedisPool } from 'tedis'"},{"note":"Use the import type for TypeScript type annotations: import type { Tedis } from 'tedis'.","wrong":"","symbol":"Tedis (type usage)","correct":"import { Tedis } from 'tedis'"}],"quickstart":{"code":"import { Tedis, TedisPool } from 'tedis';\nimport { promisify } from 'util';\n\nasync function main() {\n  // Single connection with password\n  const tedis = new Tedis({\n    port: 6379,\n    host: '127.0.0.1',\n    password: process.env.REDIS_PASSWORD ?? ''\n  });\n\n  await tedis.set('foo', 'bar');\n  const value = await tedis.get('foo');\n  console.log(value); // 'bar'\n\n  // Connection pool example\n  const pool = new TedisPool({\n    port: 6379,\n    host: '127.0.0.1'\n  });\n\n  const conn = await pool.getTedis();\n  await conn.set('pool', 'test');\n  console.log(await conn.get('pool'));\n  pool.putTedis(conn);\n  \n  await tedis.close();\n  await pool.drain();\n}\n\nmain().catch(console.error);","lang":"typescript","description":"Creates a single connection and a connection pool, performs SET/GET commands, then gracefully closes connections."},"warnings":[{"fix":"Use `await tedis.command('SET', 'key', 'value')` or `await tedis.set('key', 'value')` for string commands.","message":"Command method 'command' expects array of arguments, but some users mistakenly pass a single argument or string.","severity":"breaking","affected_versions":">=0.0.1"},{"fix":"Always use `password` field in options; `auth_pass` is not supported.","message":"The `Tedis` constructor accepts `password` but the property should be `auth_pass`? Check documentation.","severity":"deprecated","affected_versions":">=0.1.0"},{"fix":"Wrap connection code in try-catch or use .catch() on the promise.","message":"Missing error handling when Redis server is not running: 'ECONNREFUSED' error is thrown as unhandled promise.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Always call pool.putTedis(conn) in a finally block or use a wrapper.","message":"TedisPool.putTedis() must be called after using a connection, otherwise connections are leaked.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Parse numbers manually or use simple get/set for numbers.","message":"The `command` method returns raw Redis response; for hashes, hgetall returns an object with string values even if original values are numbers.","severity":"gotcha","affected_versions":">=0.0.1"}],"env_vars":null,"search_vec":"'0.1.2':19 'advanc':58 'api':32 'appear':61 'async':75 'async/await':13 'await':76 'base':7,31 'cadenc':70 'cjs':25 'client':9 'cluster':55 'command':41 'compar':44 'connect':36 'definit':17 'develop':60 'direct':40 'earli':65 'esm':23 'featur':59 'full':15 'ioredi':46 'javascript':71 'lack':54 'latest':20 'lightweight':52 'low':68 'node.js':11 'offer':21 'pool':37 'promis':30,77 'promise-bas':29 'provid':34 'redi':8,73 'releas':69 'simpler':49 'stage':66 'support':12,26,56 'tedi':1,2,72 'tedis.command':43 'tedispool':38 'typescript':6,16,74 'typescript-bas':5 'version':18 'via':42","created_at":"2026-06-07T12:58:41.874314+00:00","updated_at":"2026-06-07T12:58:41.874314+00:00","problems":[{"fix":"Use named import: import { Tedis } from 'tedis'","cause":"Imported Tedis incorrectly (e.g., import Tedis from 'tedis' instead of import { Tedis } from 'tedis').","error":"TypeError: tedis.command is not a function"},{"fix":"Start Redis server or check host/port configuration.","cause":"Redis server not running or host/port incorrect.","error":"Error: Redis connection refused (ECONNREFUSED)"},{"fix":"Ensure Tedis instance is created correctly and connection is open before calling methods.","cause":"Using Tedis after connection closed or not properly instantiated.","error":"TypeError: tedis.set is not a function"},{"fix":"Pass password in constructor options: new Tedis({ password: 'your_pass' })","cause":"Redis server requires password but not provided or incorrect password.","error":"Error: NOAUTH Authentication required"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/myour-cc/tedis#readme","github":"https://github.com/myour-cc/tedis","docs":null,"changelog":null,"pypi":null,"npm":"redis-typescript","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}