silkjs / Tedis
Licence: mit
redis client with typescript and esnext for nodejs
Stars: ✭ 109
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
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
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
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
- del
- dump
- exists
- expire
- expireat
- keys
- migrate
- move
- object
- persist
- pexpire
- pexpireat
- pttl
- randomkey
- rename
- renamenx
- restore
- scan
- sort
- touch
- ttl
- type
- unlink
- wait
string
- append
- bitcount
- bitfield
- bitop
- bitpos
- decr
- decrby
- get
- getbit
- getrange
- getset
- incr
- incrby
- incrbyfloat
- mget
- mset
- msetnx
- psetex
- set
- setbit
- setex
- setnx
- setrange
- strlen
hash
- hdel
- hexists
- hget
- hgetall
- hincrby
- hincrbyfloat
- hkeys
- hlen
- hmget
- hmset
- hscan
- hset
- hsetnx
- hstrlen
- hvals
list
- blpop
- brpop
- brpoplpush
- lindex
- linsert
- llen
- lpop
- lpush
- lpushx
- lrange
- lrem
- lset
- ltrim
- rpop
- rpoplpush
- rpush
- rpushx
set
- sadd
- scard
- sdiff
- sdiffstore
- sinter
- sinterstore
- sismember
- smembers
- smove
- spop
- srandmember
- srem
- sscan
- sunion
- sunionstore
zset
- bzpopmax
- bzpopmin
- zadd
- zcard
- zcount
- zincrby
- zinterstore
- zlexcount
- zpopmax
- zpopmin
- zrange
- zrangebylex
- zrangebyscore
- zrank
- zrem
- zremrangebylex
- zremrangebyrank
- zremrangebyscore
- zrevrange
- zrevrangebylex
- zrevrangebyscore
- zrevrank
- zscan
- zscore
- zunionstore
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].