Skip to content

Commit cb0aad6

Browse files
committed
first commit
1 parent 59fec0c commit cb0aad6

10 files changed

+1497
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.idea
2+
node_modules
3+
dist

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,25 @@
11
# redis-on-worker
2+
23
Connect to your Redis server using cloudflare:sockets
4+
5+
## Installation
6+
7+
```sh
8+
npm install redis-on-worker
9+
```
10+
11+
## Usage
12+
13+
```ts
14+
import { createRedis } from "redis-on-worker";
15+
16+
const redis = createRedis({
17+
url: "redis://<username>:<password>@<host>:<port>",
18+
});
19+
20+
await redis("SET", "foo", "bar");
21+
22+
const value = await redis("GET", "foo");
23+
24+
console.log(value); // bar
25+
```

package.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "redis-on-worker",
3+
"version": "0.1.0",
4+
"description": "Connect to your Redis server using cloudflare:sockets",
5+
"main": "index.js",
6+
"scripts": {
7+
"build": "tsup",
8+
"test": "echo \"Error: no test specified\" && exit 1"
9+
},
10+
"exports": {
11+
".": {
12+
"types": "./dist/index.d.ts",
13+
"import": "./dist/index.mjs",
14+
"require": "./dist/index.js"
15+
},
16+
"./package.json": "./package.json"
17+
},
18+
"keywords": ["redis", "cloudflare", "workers", "typescript", "socket", "tcp"],
19+
"author": {
20+
"name": "Kane",
21+
"email": "[email protected]"
22+
},
23+
"license": "MIT",
24+
"devDependencies": {
25+
"@cloudflare/workers-types": "^4.20240222.0",
26+
"@types/node": "^20.11.24",
27+
"@types/redis-errors": "^1.2.3",
28+
"@types/redis-parser": "^3.0.3",
29+
"prettier": "^3.2.5",
30+
"prettier-plugin-organize-imports": "^3.2.4",
31+
"redis-errors": "^1.2.0",
32+
"tsup": "^8.0.2",
33+
"typescript": "^5.3.3"
34+
},
35+
"dependencies": {
36+
"@redis/client": "^1.5.14",
37+
"redis-parser": "^3.0.0"
38+
}
39+
}

0 commit comments

Comments
 (0)