Simple, lightweight Redis client library for Deno.

Overview

r2d2

Simple, lightweight Redis client library for Deno.

Usage

Basic commands

import { sendCommand } from "https://deno.land/x/r2d2/mod.ts";

const redisConn = await Deno.connect({ port: 6379 });

/** Resolves to "OK" */
await sendCommand(redisConn, ["SET", "hello", "world"]);

/** Prints "world" */
console.log(await sendCommand(redisConn, ["GET", "hello"]));

redisConn.close();

If you'd like to ignore the reply.

await sendCommand(redis, ["SHUTDOWN"], false);

Pipelining

import { pipelineCommands } from "https://deno.land/x/r2d2/mod.ts";

const redisConn = await Deno.connect({ port: 6379 });

// Resolves to [1, 2, 3, 4]
await pipelineCommands(redisConn, [
  ["INCR", "X"],
  ["INCR", "X"],
  ["INCR", "X"],
  ["INCR", "X"],
]);

Principles

  1. Designed to be fundamentally simple
  2. Takes advantage of native Deno APIs and Deno's standard library without custom classes
  3. Promotes using Redis commands without intermediate abstractions

Prerequisites

Redis must be installed on your local machine (guide here). Doing so enables the use of the redis-server CLI tool, which is used to start a local Redis server for testing and benchmarks.

Testing

deno task test

Benchmarks

deno task bench
You might also like...

deno-ja (Deno Japanese community) showcase

Showcase Deno本家よりも気軽に作ったものを公開できるようなShowcaseです。 スクリーンショットの撮影方法 短めのidを決めていただいて、下記のようにスクリプトを実行してください。 deno task screenshot [url] [id] ※エラーが出る場合は、下記を実行してみ

Oct 28, 2022

A command-line tool to manage Deno scripts installed via deno install

🏞️ nublar nublar is a command-line tool to manage your scripts installed via deno install. 🛳️ Installation deno install --allow-read --allow-write -

Dec 26, 2022

Deno client library for Bitwarden CLI's local REST API.

Bweno Think outside the bun 🌮 Bweno is a client library for Bitwarden CLI's local REST API. Pronounced as Spanish 'bueno', meaning 'good'. Requiremen

May 26, 2022

Improved Deno port of GramJS — a MTProto API Telegram client library.

Warning Considered as unstable. But, most of the commonly used features are working as expected. Grm Grm is an improved Deno port of GramJS, written i

Dec 31, 2022

GraphErr is an open-source error handling library for GraphQL implementations in Deno. It's a lightweight solution that provides developers with descriptive error messages, reducing ambiguity and improving debugging.

GraphErr is an open-source error handling library for GraphQL implementations in Deno. It's a lightweight solution that provides developers with descriptive error messages, reducing ambiguity and improving debugging.

GraphErr Descriptive GraphQL error handling for Deno/Oak servers. Features Provides additional context to GraphQL's native error messaging for faster

Nov 1, 2022

A RESP 'Redis Serialization Protocol' library implementation to generate a server, uses a similar approach to express to define you serer, making it easy and fast.

A RESP 'Redis Serialization Protocol' library implementation to generate a server, uses a similar approach to express to define you serer, making it easy and fast.

RESPRESS A RESP 'Redis Serialization Protocol' library implementation to generate a server, uses a similar approach to express to define you serer, ma

Aug 29, 2022

EggyJS is a Javascript micro Library for simple, lightweight toast popups focused on being dependency-less, lightweight, quick and efficient.

EggyJS EggyJS is a Javascript micro Library for simple, lightweight toast popups. The goal of this library was to create something that meets the foll

Jan 8, 2023

Postgres.js - The Fastest full featured PostgreSQL client for Node.js and Deno

Postgres.js - The Fastest full featured PostgreSQL client for Node.js and Deno

🚀 Fastest full-featured node & deno client 🏷 ES6 Tagged Template Strings at the core 🏄‍♀️ Simple surface API 🖊️ Dynamic query support 💬 Chat and

Jan 1, 2023

MTProto API Client for Deno 🦕

Grm MTProto client for Deno ported from GramJS. Documentation Currently, there is no documentation dedicated to Grm. You can use the GramJS documentat

Dec 17, 2022
Releases(v1.1.3)
  • v1.1.3(Dec 4, 2022)

    What's Changed

    • chore: update dependencies by @iuioiua in https://github.com/iuioiua/r2d2/pull/92
    • docs: add retry example and improve timeout docs by @iuioiua in https://github.com/iuioiua/r2d2/pull/93

    Full Changelog: https://github.com/iuioiua/r2d2/compare/v1.1.2...v1.1.3

    Source code(tar.gz)
    Source code(zip)
  • v1.1.2(Nov 27, 2022)

    What's Changed

    • refactor: remove deprecated listenReplies function by @iuioiua in https://github.com/iuioiua/r2d2/pull/83
    • refactor: move writeAll and readLines in-house by @iuioiua in https://github.com/iuioiua/r2d2/pull/84
    • fix: don't export readLines by @iuioiua in https://github.com/iuioiua/r2d2/pull/85

    Full Changelog: https://github.com/iuioiua/r2d2/compare/v1.1.1...v1.1.2

    Source code(tar.gz)
    Source code(zip)
  • v1.1.1(Nov 27, 2022)

    What's Changed

    • refactor: minor tweaks for clarity by @iuioiua in https://github.com/iuioiua/r2d2/pull/80
    • fix: documentation typos by @iuioiua in https://github.com/iuioiua/r2d2/pull/81
    • chore: update comparison documentation by @iuioiua in https://github.com/iuioiua/r2d2/pull/82

    Full Changelog: https://github.com/iuioiua/r2d2/compare/v1.1.0...v1.1.1

    Source code(tar.gz)
    Source code(zip)
  • v1.1.0(Nov 27, 2022)

    What's Changed

    • refactor: use readDelim instead of readStringDelim by @iuioiua in https://github.com/iuioiua/r2d2/pull/76
    • fix: hset args for node-redis bench by @iuioiua in https://github.com/iuioiua/r2d2/pull/77
    • feat: handle no reply by @iuioiua in https://github.com/iuioiua/r2d2/pull/78
    • feat: support read/write of raw data by @iuioiua in https://github.com/iuioiua/r2d2/pull/79

    Full Changelog: https://github.com/iuioiua/r2d2/compare/v1.0.8...v1.1.0

    Source code(tar.gz)
    Source code(zip)
  • v1.0.8(Nov 14, 2022)

    What's Changed

    • feat: eval and Lua script examples and tests by @iuioiua in https://github.com/iuioiua/r2d2/pull/66
    • doc: update features section of README.md by @iuioiua in https://github.com/iuioiua/r2d2/pull/67
    • remove: unstable flag for deno task bench by @iuioiua in https://github.com/iuioiua/r2d2/pull/68
    • fix: add pipelining to node-redis benchmark by @iuioiua in https://github.com/iuioiua/r2d2/pull/69
    • doc: comparison section by @iuioiua in https://github.com/iuioiua/r2d2/pull/70
    • doc: minor tweaks for clarity by @iuioiua in https://github.com/iuioiua/r2d2/pull/71
    • chore: update dependencies by @iuioiua in https://github.com/iuioiua/r2d2/pull/72

    Full Changelog: https://github.com/iuioiua/r2d2/compare/v1.0.7...v1.0.8

    Source code(tar.gz)
    Source code(zip)
  • v1.0.7(Nov 13, 2022)

    What's Changed

    • feat: deprecate listenReplies and add readReplies by @iuioiua in https://github.com/iuioiua/r2d2/pull/65

    Full Changelog: https://github.com/iuioiua/r2d2/compare/v1.0.6...v1.0.7

    Source code(tar.gz)
    Source code(zip)
  • v1.0.6(Nov 10, 2022)

    What's Changed

    • refactor: use readStringDelim from std/io by @iuioiua in https://github.com/iuioiua/r2d2/pull/53
    • remove: unnecessary exports by @iuioiua in https://github.com/iuioiua/r2d2/pull/57
    • refactor: use iterator.next() instead of readReply() where necessary by @iuioiua in https://github.com/iuioiua/r2d2/pull/58
    • fixed: JSDoc blocks for Deno doc website by @iuioiua in https://github.com/iuioiua/r2d2/pull/59
    • fix: ignore test.ts in coverage tool by @iuioiua in https://github.com/iuioiua/r2d2/pull/60
    • feat: re-add null array test by @iuioiua in https://github.com/iuioiua/r2d2/pull/61

    Full Changelog: https://github.com/iuioiua/r2d2/compare/v1.0.5...v1.0.6

    Source code(tar.gz)
    Source code(zip)
  • v1.0.5(Nov 9, 2022)

    What's Changed

    • chore: update dependencies by @iuioiua in https://github.com/iuioiua/r2d2/pull/45
    • fix: flaky tests from data persistence by @iuioiua in https://github.com/iuioiua/r2d2/pull/46
    • refactor: use readLines from std/io by @iuioiua in https://github.com/iuioiua/r2d2/pull/47
    • chore: upgrade to [email protected] by @iuioiua in https://github.com/iuioiua/r2d2/pull/48
    • chore: ignore deno.lock by @iuioiua in https://github.com/iuioiua/r2d2/pull/49
    • chore: delete deno.lock by @iuioiua in https://github.com/iuioiua/r2d2/pull/50
    • doc: add transactions example by @iuioiua in https://github.com/iuioiua/r2d2/pull/51
    • refactor: smaller tests by @iuioiua in https://github.com/iuioiua/r2d2/pull/52

    Full Changelog: https://github.com/iuioiua/r2d2/compare/v1.0.4...v1.0.5

    Source code(tar.gz)
    Source code(zip)
  • v1.0.4(Nov 6, 2022)

    What's Changed

    • fix: large reply bug by @iuioiua in https://github.com/iuioiua/r2d2/pull/44

    Full Changelog: https://github.com/iuioiua/r2d2/compare/v1.0.3...v1.0.4

    Source code(tar.gz)
    Source code(zip)
  • v1.0.3(Nov 6, 2022)

    What's Changed

    • chore: add dependency versions for bench by @iuioiua in https://github.com/iuioiua/r2d2/pull/41
    • chore: add RESP3 example and test by @iuioiua in https://github.com/iuioiua/r2d2/pull/42
    • docs: link features to examples by @iuioiua in https://github.com/iuioiua/r2d2/pull/43

    Full Changelog: https://github.com/iuioiua/r2d2/compare/v1.0.2...v1.0.3

    Source code(tar.gz)
    Source code(zip)
  • v1.0.2(Oct 30, 2022)

    What's Changed

    • refactor: redo usage documentation by @iuioiua in https://github.com/iuioiua/r2d2/pull/37
    • fix: timeout documentation by @iuioiua in https://github.com/iuioiua/r2d2/pull/38
    • chore: update std to 0.161.0 by @iuioiua in https://github.com/iuioiua/r2d2/pull/39
    • fix: ioredis in benchmarks by @iuioiua in https://github.com/iuioiua/r2d2/pull/40

    Full Changelog: https://github.com/iuioiua/r2d2/compare/v1.0.1...v1.0.2

    Source code(tar.gz)
    Source code(zip)
  • v1.0.1(Oct 27, 2022)

    What's Changed

    • feat: getting started and example script by @iuioiua in https://github.com/iuioiua/r2d2/pull/36

    Full Changelog: https://github.com/iuioiua/r2d2/compare/v1.0.0...v1.0.1

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Oct 27, 2022)

    What's Changed

    • chore: revert using import map for remote dependencies by @iuioiua in https://github.com/iuioiua/r2d2/pull/2
    • refactor: restructure files by @iuioiua in https://github.com/iuioiua/r2d2/pull/3
    • refactor: test structure by @iuioiua in https://github.com/iuioiua/r2d2/pull/4
    • chore: simplifications and cleanups by @iuioiua in https://github.com/iuioiua/r2d2/pull/5
    • feat: basic RESP3 support (strings and integers only) by @iuioiua in https://github.com/iuioiua/r2d2/pull/6
    • feat(RESP3): support boolean replies by @iuioiua in https://github.com/iuioiua/r2d2/pull/7
    • feat(RESP3): support null replies by @iuioiua in https://github.com/iuioiua/r2d2/pull/8
    • chore: simplify serialization by @iuioiua in https://github.com/iuioiua/r2d2/pull/9
    • refactor: reply tests by @iuioiua in https://github.com/iuioiua/r2d2/pull/10
    • fix: correctly name reply test by @iuioiua in https://github.com/iuioiua/r2d2/pull/11
    • feat(RESP3): read double reply by @iuioiua in https://github.com/iuioiua/r2d2/pull/12
    • feat(RESP3): read blob error reply by @iuioiua in https://github.com/iuioiua/r2d2/pull/13
    • refactor: combine similar functions by @iuioiua in https://github.com/iuioiua/r2d2/pull/14
    • feat(RESP3): read big number reply by @iuioiua in https://github.com/iuioiua/r2d2/pull/15
    • feat(RESP3): read map reply by @iuioiua in https://github.com/iuioiua/r2d2/pull/16
    • feat(RESP3): read set reply by @iuioiua in https://github.com/iuioiua/r2d2/pull/17
    • refactor: request functions by @iuioiua in https://github.com/iuioiua/r2d2/pull/18
    • feat(RESP3): read streamed string reply by @iuioiua in https://github.com/iuioiua/r2d2/pull/19
    • feat(RESP3): read streamed array reply by @iuioiua in https://github.com/iuioiua/r2d2/pull/20
    • feat(RESP3): read streamed set reply by @iuioiua in https://github.com/iuioiua/r2d2/pull/21
    • feat(RESP3): read streamed map reply by @iuioiua in https://github.com/iuioiua/r2d2/pull/22
    • refactor: simplify reply workings by @iuioiua in https://github.com/iuioiua/r2d2/pull/23
    • refactor: move main tests by @iuioiua in https://github.com/iuioiua/r2d2/pull/24
    • chore: update dependencies by @iuioiua in https://github.com/iuioiua/r2d2/pull/25
    • refactor: reorganisations and renaming by @iuioiua in https://github.com/iuioiua/r2d2/pull/26
    • feat: request test by @iuioiua in https://github.com/iuioiua/r2d2/pull/27
    • chore: further reorganising by @iuioiua in https://github.com/iuioiua/r2d2/pull/28
    • feat(RESP3): read attribute reply by @iuioiua in https://github.com/iuioiua/r2d2/pull/29
    • feat(RESP3): read push reply by @iuioiua in https://github.com/iuioiua/r2d2/pull/30
    • chore: update dependencies and documentation by @iuioiua in https://github.com/iuioiua/r2d2/pull/31
    • chore: update documentation and CI by @iuioiua in https://github.com/iuioiua/r2d2/pull/32
    • feat: benchmark npm:ioredis and npm:node-redis and simplify benchmarks by @iuioiua in https://github.com/iuioiua/r2d2/pull/33
    • refactor: simplify file structure by @iuioiua in https://github.com/iuioiua/r2d2/pull/34

    Full Changelog: https://github.com/iuioiua/r2d2/compare/v0.0.15...v1.0.0

    Source code(tar.gz)
    Source code(zip)
  • v0.0.15(Sep 9, 2022)

    What's Changed

    • remove: support of binary data by @iuioiua in https://github.com/iuioiua/r2d2/pull/1

    New Contributors

    • @iuioiua made their first contribution in https://github.com/iuioiua/r2d2/pull/1

    Full Changelog: https://github.com/iuioiua/r2d2/compare/v0.0.14...v0.0.15

    Source code(tar.gz)
    Source code(zip)
  • v0.0.14(Aug 12, 2022)

  • v0.0.13(Aug 9, 2022)

  • v0.0.12(Aug 1, 2022)

  • v0.0.11(Jul 30, 2022)

  • v0.0.10(Jul 29, 2022)

  • v0.0.9(Jul 26, 2022)

  • v0.0.8(Jul 25, 2022)

  • v0.0.7(Jul 9, 2022)

  • v0.0.6(Jul 6, 2022)

  • v0.0.5(Jul 5, 2022)

  • v0.0.4(Jul 5, 2022)

  • v0.0.3(Jul 3, 2022)

  • v0.0.2(Jun 30, 2022)

  • v0.0.1(Jun 30, 2022)

Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
RedisInsight - Developer GUI for Redis, by Redis.

RedisInsight - Developer GUI for Redis, by Redis. RedisInsight is a visual tool that provides capabilities to design, develop and optimize your Redis

null 2.3k Dec 31, 2022
Opinionated collection of TypeScript definitions and utilities for Deno and Deno Deploy. With complete types for Deno/NPM/TS config files, constructed from official JSON schemas.

Schemas Note: You can also import any type from the default module, ./mod.ts deno.json import { type DenoJson } from "https://deno.land/x/[email protected]

deno911 2 Oct 12, 2022
This is a simple boilerplate for a Deno website, deployed with Deno Deploy.

Simple Deno Website Boilerplate This is a simple website boilerplate built using Deno and deployed using Deno Deploy. Demo at simple-deno-website-boil

Bruno Bernardino 15 Dec 3, 2022
A small, but powerful HTTP library for Deno & Deno Deploy, built for convenience and simplicity

Wren Wren is a small, but powerful HTTP library for Deno & Deno Deploy, built for convenience and simplicity. convenient aliases for HTTP responses au

Jakub Neander 69 Dec 12, 2022
⚡ the first open-source redis client made with care and acessibility-first 🚀

⚡ Redis UI The first open-source project to create an awesome and accessible UI for Redis as a native desktop application. ✨ ?? ?? How to develop loca

Nicolas Lopes Aquino 14 Dec 5, 2022
TypeSafe MongoDB Atlas Data API SDK for Deno & Deno Deploy

Atlas SDK atlas_sdk is a TypeSafe MongoDB Atlas Data API SDK for Deno & Deno Deploy Links Docs Import Replace LATEST_VERSION with current latest versi

Erfan Safari 20 Dec 26, 2022
Deno bindings for yoga, using Deno FFI.

deno_yoga Deno bindings for yoga, using Deno FFI. Usage flags: --allow-ffi: Requires ffi access to "yogacore.dll", "libyogacore.so", "libyogacore.dyli

迷渡 6 Feb 11, 2022
🛣️ A tiny and fast http request router designed for use with deno and deno deploy

Rutt Rutt is a tiny http router designed for use with deno and deno deploy. It is written in about 200 lines of code and is pretty fast, using an exte

Denosaurs 26 Dec 10, 2022