All Projects → silkjs → Tedis

silkjs / Tedis

Licence: mit
redis client with typescript and esnext for nodejs

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Tedis

Before After Hook
wrap methods with before/after hooks
Stars: ✭ 49 (-55.05%)
Mutual labels:  async, promise
Flowa
🔥Service level control flow for Node.js
Stars: ✭ 66 (-39.45%)
Mutual labels:  async, promise
Download
Download and extract files
Stars: ✭ 1,064 (+876.15%)
Mutual labels:  async, promise
Rq
Simple job queues for Python
Stars: ✭ 8,065 (+7299.08%)
Mutual labels:  async, redis
Datakernel
Alternative Java platform, built from the ground up - with its own async I/O core and DI. Ultra high-performance, simple and minimalistic - redefines server-side programming, web-development and highload!
Stars: ✭ 87 (-20.18%)
Mutual labels:  async, promise
Node Qiniu Sdk
七牛云SDK,使用 ES2017 async functions 来操作七牛云,接口名称与官方接口对应,轻松上手,文档齐全
Stars: ✭ 44 (-59.63%)
Mutual labels:  async, promise
Promised Pipe
A ramda.pipe-like utility that handles promises internally with zero dependencies
Stars: ✭ 64 (-41.28%)
Mutual labels:  async, promise
Yii2 Queue
Yii2 Queue Extension. Supports DB, Redis, RabbitMQ, Beanstalk and Gearman
Stars: ✭ 977 (+796.33%)
Mutual labels:  async, redis
Memento
Fairly basic redis-like hashmap implementation on top of a epoll TCP server.
Stars: ✭ 74 (-32.11%)
Mutual labels:  async, redis
Write
Write data to the file system, creating any intermediate directories if they don't already exist. Used by flat-cache and many others!
Stars: ✭ 68 (-37.61%)
Mutual labels:  async, promise
Breeze
Javascript async flow control manager
Stars: ✭ 38 (-65.14%)
Mutual labels:  async, promise
Redis
Async Redis Client for PHP based on Amp.
Stars: ✭ 107 (-1.83%)
Mutual labels:  async, redis
Spring Boot
spring-boot 项目实践总结
Stars: ✭ 989 (+807.34%)
Mutual labels:  async, redis
Emacs Async Await
Async/Await for Emacs
Stars: ✭ 47 (-56.88%)
Mutual labels:  async, promise
Fritzbox.js
☎️ The leading AVM Fritz!Box API for NodeJS and JavaScript.
Stars: ✭ 36 (-66.97%)
Mutual labels:  async, promise
Redisgo Async
RedisGo-Async is a Go client for Redis, both asynchronous and synchronous modes are supported,its API is fully compatible with redigo.
Stars: ✭ 60 (-44.95%)
Mutual labels:  async, redis
Nodespider
[DEPRECATED] Simple, flexible, delightful web crawler/spider package
Stars: ✭ 33 (-69.72%)
Mutual labels:  async, promise
Create Request
Apply interceptors to `fetch` and create a custom request function.
Stars: ✭ 34 (-68.81%)
Mutual labels:  async, promise
Emittery
Simple and modern async event emitter
Stars: ✭ 1,146 (+951.38%)
Mutual labels:  async, promise
Taskorama
⚙ A Task/Future data type for JavaScript
Stars: ✭ 90 (-17.43%)
Mutual labels:  async, promise

tedis logo

travis issues license package Coverage Status tag
pr release languages size commit

Supporting Tedis

Introduction

What is tedis

Tedis write with typescript, it's the client of redis for nodejs, support async with ts and commonjs

Installation

yarn add tedis

Getting started

commonjs

const { Tedis, TedisPool } = require("tedis");

typescript

import { Tedis, TedisPool } from "tedis";
// no auth
const tedis = new Tedis({
  port: 6379,
  host: "127.0.0.1"
});

// auth
const tedis = new Tedis({
  port: 6379,
  host: "127.0.0.1",
  password: "your_password"
});

tls

const tedis = new Tedis({
  port: 6379,
  host: "127.0.0.1",
  tls: {
    key: fs.readFileSync(__dirname + "/client_server/client_key.pem"),
    cert: fs.readFileSync(__dirname + "/client_server/client_cert.pem")
  }
});

TedisPool

// no auth
const pool = new TedisPool({
  port: 6379,
  host: "127.0.0.1"
});

// auth
const pool = new TedisPool({
  port: 6379,
  host: "127.0.0.1",
  password: "your_password"
});
const tedis = await pool.getTedis();
// ... do some commands
pool.putTedis(tedis);

tls

const tedis = new TedisPool({
  port: 6379,
  host: "127.0.0.1",
  tls: {
    key: fs.readFileSync(__dirname + "/client_server/client_key.pem"),
    cert: fs.readFileSync(__dirname + "/client_server/client_cert.pem")
  }
});

Example

/**
 * core
 */
await tedis.command("SET", "key1", "Hello");
// "OK"
await tedis.command("SET", "key2", "World");
// "OK"

/**
 * key
 */
await tedis.keys("*");
// []
await tedis.exists("a");
// 0

/**
 * string
 */
await tedis.set("mystring", "hello");
// "OK"
await tedis.get("mystring");
// "hello"

/**
 * hash
 */
await tedis.hmset("myhash", {
  name: "tedis",
  age: 18
});
// "OK"
await tedis.hgetall("myhash");
// {
//   "name": "tedis",
//   "age": "18"
// }

/**
 * list
 */
await tedis.lpush("mylist", "hello", "a", "b", "c", "d", 1, 2, 3, 4);
// 9
await tedis.llen("mylist");
// 9

Type interface

base

pool

key

string

hash

list

set

zset

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].