Skip to content

Commit

Permalink
refactor: update for Deno 2 (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
iuioiua authored Oct 31, 2024
1 parent 820c43f commit c9624f6
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 21 deletions.
3 changes: 1 addition & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
interval: "weekly"
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # The OIDC ID token is used for authentication with JSR.
id-token: write # The OIDC ID token is used for authentication with JSR.
steps:
- uses: actions/checkout@v4
- run: npx jsr publish
- run: npx jsr publish
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Must be run with `--allow-net` permission. Check out the full documentation

### RESPv2

```ts
```ts ignore
import { RedisClient } from "jsr:@iuioiua/r2d2";

const redisConn = await Deno.connect({ port: 6379 });
Expand All @@ -39,7 +39,7 @@ await redisClient.sendCommand(["GET", "hello"]);

If you don't care about the reply:

```ts
```ts ignore
import { RedisClient } from "jsr:@iuioiua/r2d2";

const redisConn = await Deno.connect({ port: 6379 });
Expand All @@ -51,7 +51,7 @@ await redisClient.writeCommand(["SHUTDOWN"]);

### RESP3

```ts
```ts ignore
import { RedisClient } from "jsr:@iuioiua/r2d2";

const redisConn = await Deno.connect({ port: 6379 });
Expand All @@ -72,7 +72,7 @@ await redisClient.sendCommand(["HGETALL", "hash3"]);
Set the last argument, `raw`, to `true` and bulk string replies will return raw
data instead of strings.

```ts
```ts ignore
import { RedisClient } from "jsr:@iuioiua/r2d2";

const redisConn = await Deno.connect({ port: 6379 });
Expand All @@ -89,7 +89,7 @@ await redisClient.sendCommand(["GET", "binary"], true);

### Pipelining

```ts
```ts ignore
import { RedisClient } from "jsr:@iuioiua/r2d2";

const redisConn = await Deno.connect({ port: 6379 });
Expand All @@ -106,7 +106,7 @@ await redisClient.pipelineCommands([

### Pub/Sub

```ts
```ts ignore
import { RedisClient } from "jsr:@iuioiua/r2d2";

const redisConn = await Deno.connect({ port: 6379 });
Expand All @@ -121,7 +121,7 @@ for await (const reply of redisClient.readReplies()) {

### Transactions

```ts
```ts ignore
import { RedisClient } from "jsr:@iuioiua/r2d2";

const redisConn = await Deno.connect({ port: 6379 });
Expand All @@ -142,7 +142,7 @@ await redisClient.sendCommand(["EXEC"]);

### Eval Scripts

```ts
```ts ignore
import { RedisClient } from "jsr:@iuioiua/r2d2";

const redisConn = await Deno.connect({ port: 6379 });
Expand All @@ -154,7 +154,7 @@ await redisClient.sendCommand(["EVAL", "return ARGV[1]", 0, "hello"]);

### Lua Scripts

```ts
```ts ignore
import { RedisClient } from "jsr:@iuioiua/r2d2";

const redisConn = await Deno.connect({ port: 6379 });
Expand All @@ -176,7 +176,7 @@ await redisClient.sendCommand(["FCALL", "knockknock", 0]);
For further details on `deadline()`, see the documentation
[here](https://jsr.io/@std/async/doc/~/deadline).

```ts
```ts ignore
import { deadline } from "jsr:@std/async";
import { RedisClient } from "jsr:@iuioiua/r2d2";

Expand All @@ -194,7 +194,7 @@ await deadline(redisClient.sendCommand(["SLOWLOG", "GET"]), 100);
For further details on `retry()`, see the documentation
[here](https://jsr.io/@std/async/doc/~/retry).

```ts
```ts ignore
import { retry } from "jsr:@std/async";
import { RedisClient } from "jsr:@iuioiua/r2d2";

Expand Down
12 changes: 6 additions & 6 deletions mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type { Writer } from "@std/io/types";
/**
* A Redis client that can be used to send commands to a Redis server.
*
* ```ts
* ```ts ignore
* import { RedisClient } from "jsr:@iuioiua/r2d2";
*
* const redisConn = await Deno.connect({ port: 6379 });
Expand Down Expand Up @@ -283,7 +283,7 @@ class AsyncQueue {
* A Redis client that can be used to send commands to a Redis server.
*
* @example
* ```ts
* ```ts ignore
* import { RedisClient } from "jsr:@iuioiua/r2d2";
*
* const redisConn = await Deno.connect({ port: 6379 });
Expand All @@ -310,7 +310,7 @@ export class RedisClient {
* Sends a command to the Redis server and returns the parsed reply.
*
* @example
* ```ts
* ```ts ignore
* import { RedisClient } from "jsr:@iuioiua/r2d2";
*
* const redisConn = await Deno.connect({ port: 6379 });
Expand All @@ -333,7 +333,7 @@ export class RedisClient {
* Just writes a command to the Redis server without listening for a reply.
*
* @example
* ```ts
* ```ts ignore
* import { RedisClient } from "jsr:@iuioiua/r2d2";
*
* const redisConn = await Deno.connect({ port: 6379 });
Expand All @@ -352,7 +352,7 @@ export class RedisClient {
* Used for pub/sub. Listens for replies from the Redis server.
*
* @example
* ```ts
* ```ts ignore
* import { RedisClient } from "jsr:@iuioiua/r2d2";
*
* const redisConn = await Deno.connect({ port: 6379 });
Expand All @@ -374,7 +374,7 @@ export class RedisClient {
* Pipelines commands to the Redis server and returns the parsed replies.
*
* @example
* ```ts
* ```ts ignore
* import { RedisClient } from "jsr:@iuioiua/r2d2";
*
* const redisConn = await Deno.connect({ port: 6379 });
Expand Down

0 comments on commit c9624f6

Please sign in to comment.