@bejibun/redis 0.1.24 → 0.1.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +23 -5
- package/builders/RedisBuilder.js +2 -2
- package/bun.lock +4 -4
- package/package.json +3 -3
- package/src/builders/RedisBuilder.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file.
|
|
|
3
3
|
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
## [v0.1.26](https://github.com/crenata/bejibun-redis/compare/v0.1.24...v0.1.26) - 2025-10-18
|
|
7
|
+
|
|
8
|
+
### 🩹 Fixes
|
|
9
|
+
|
|
10
|
+
### 📖 Changes
|
|
11
|
+
What's New :
|
|
12
|
+
- A minor adjustment on error logs
|
|
13
|
+
|
|
14
|
+
### ❤️Contributors
|
|
15
|
+
- Havea Crenata ([@crenata](https://github.com/crenata))
|
|
16
|
+
- Ghulje ([@ghulje](https://github.com/ghulje))
|
|
17
|
+
|
|
18
|
+
**Full Changelog**: https://github.com/crenata/bejibun-redis/blob/master/CHANGELOG.md
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
6
22
|
## [v0.1.24](https://github.com/crenata/bejibun-redis/compare/v0.1.23...v0.1.24) - 2025-10-16
|
|
7
23
|
|
|
8
24
|
### 🩹 Fixes
|
package/README.md
CHANGED
|
@@ -55,15 +55,20 @@ You can pass the value with environment variables.
|
|
|
55
55
|
How to use tha package.
|
|
56
56
|
|
|
57
57
|
```ts
|
|
58
|
-
import
|
|
58
|
+
import type {RedisPipeline} from "@bejibun/redis/types";
|
|
59
|
+
import BaseController from "@bejibun/core/bases/BaseController";
|
|
60
|
+
import Logger from "@bejibun/logger";
|
|
61
|
+
import Redis from "@bejibun/redis";
|
|
59
62
|
import {BunRequest} from "bun";
|
|
60
|
-
import BaseController from "@/app/controllers/BaseController";
|
|
61
63
|
|
|
62
64
|
export default class TestController extends BaseController {
|
|
63
65
|
public async redis(request: BunRequest): Promise<Response> {
|
|
64
66
|
await Redis.set("redis", {hello: "world"});
|
|
65
67
|
const redis = await Redis.get("redis");
|
|
66
68
|
|
|
69
|
+
await Redis.connection("local").set("connection", "This is using custom connection.");
|
|
70
|
+
const connection = await Redis.connection("local").get("connection");
|
|
71
|
+
|
|
67
72
|
const pipeline = await Redis.pipeline((pipe: RedisPipeline) => {
|
|
68
73
|
pipe.set("redis-pipeline-1", "This is redis pipeline 1");
|
|
69
74
|
pipe.set("redis-pipeline-2", "This is redis pipeline 2");
|
|
@@ -73,17 +78,30 @@ export default class TestController extends BaseController {
|
|
|
73
78
|
});
|
|
74
79
|
|
|
75
80
|
const subscriber = await Redis.subscribe("redis-subscribe", (message: string, channel: string) => {
|
|
76
|
-
|
|
81
|
+
Logger.setContext(channel).debug(message);
|
|
77
82
|
});
|
|
78
83
|
await Redis.publish("redis-subscribe", "Hai redis subscriber!");
|
|
79
84
|
setTimeout(async () => {
|
|
80
85
|
await subscriber.unsubscribe();
|
|
81
86
|
}, 500);
|
|
82
87
|
|
|
83
|
-
return super.response.setData({redis, pipeline}).send();
|
|
88
|
+
return super.response.setData({redis, connection, pipeline}).send();
|
|
84
89
|
}
|
|
85
90
|
}
|
|
86
91
|
```
|
|
87
92
|
|
|
88
93
|
## Contributors
|
|
89
|
-
- [Havea Crenata](mailto:havea.crenata@gmail.com)
|
|
94
|
+
- [Havea Crenata](mailto:havea.crenata@gmail.com)
|
|
95
|
+
|
|
96
|
+
## ☕ Support / Donate
|
|
97
|
+
|
|
98
|
+
If you find this project helpful and want to support it, you can donate via PayPal :
|
|
99
|
+
|
|
100
|
+
[](https://paypal.me/hafiizhghulam)
|
|
101
|
+
|
|
102
|
+
Or if you are prefer using crypto :
|
|
103
|
+
|
|
104
|
+
| EVM | Solana |
|
|
105
|
+
| --- | ------ |
|
|
106
|
+
| <img src="https://github.com/crenata/bejibun/blob/master/public/images/EVM.png?raw=true" width="150" /> | <img src="https://github.com/crenata/bejibun/blob/master/public/images/SOL.png?raw=true" width="150" /> |
|
|
107
|
+
| 0xdABe8750061410D35cE52EB2a418c8cB004788B3 | GAnoyvy9p3QFyxikWDh9hA3fmSk2uiPLNWyQ579cckMn |
|
package/builders/RedisBuilder.js
CHANGED
|
@@ -119,7 +119,7 @@ export default class RedisBuilder {
|
|
|
119
119
|
this.emitter.emit("connect", name);
|
|
120
120
|
};
|
|
121
121
|
client.onclose = (error) => {
|
|
122
|
-
|
|
122
|
+
Logger.setContext("Redis").warn(`Disconnected from "${name}" connection.`).trace(error);
|
|
123
123
|
this.emitter.emit("disconnect", name, error);
|
|
124
124
|
};
|
|
125
125
|
return client;
|
|
@@ -180,7 +180,7 @@ export default class RedisBuilder {
|
|
|
180
180
|
Logger.setContext("Redis").warn(`Disconnected on "${defineValue(signal, "exit")}".`);
|
|
181
181
|
}
|
|
182
182
|
catch (error) {
|
|
183
|
-
|
|
183
|
+
Logger.setContext("Redis").error("Error during disconnect.").trace(error);
|
|
184
184
|
}
|
|
185
185
|
finally {
|
|
186
186
|
process.exit(0);
|
package/bun.lock
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"": {
|
|
5
5
|
"name": "@bejibun/redis",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@bejibun/logger": "^0.1.
|
|
8
|
-
"@bejibun/utils": "^0.1.
|
|
7
|
+
"@bejibun/logger": "^0.1.14",
|
|
8
|
+
"@bejibun/utils": "^0.1.1",
|
|
9
9
|
},
|
|
10
10
|
"devDependencies": {
|
|
11
11
|
"@types/bun": "latest",
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
16
|
"packages": {
|
|
17
|
-
"@bejibun/logger": ["@bejibun/logger@0.1.
|
|
17
|
+
"@bejibun/logger": ["@bejibun/logger@0.1.15", "", { "dependencies": { "@bejibun/utils": "^0.1.1", "chalk": "^5.6.2", "luxon": "^3.7.2" } }, "sha512-lJlJHxwP1ZtxCfSp0bXyES+Ljskxoaa4QYDTilOWteqYbiAPYJFh+rH8kn2STvxiyAY7T/JJ55ACbjuN76kCjg=="],
|
|
18
18
|
|
|
19
|
-
"@bejibun/utils": ["@bejibun/utils@0.1.
|
|
19
|
+
"@bejibun/utils": ["@bejibun/utils@0.1.1", "", {}, "sha512-8TofYYN+EhPQgNOkyovMaAamRqbK/PisrAxjspXFlqVLj8bnmdOsZjosTpNXesLGIftn4rKkaFsfaafD//31Hg=="],
|
|
20
20
|
|
|
21
21
|
"@nodelib/fs.scandir": ["@nodelib/fs.scandir@2.1.5", "", { "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" } }, "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g=="],
|
|
22
22
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bejibun/redis",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.26",
|
|
4
4
|
"author": "Havea Crenata <havea.crenata@gmail.com>",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"type": "module",
|
|
37
37
|
"types": "index.d.ts",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@bejibun/logger": "^0.1.
|
|
40
|
-
"@bejibun/utils": "^0.1.
|
|
39
|
+
"@bejibun/logger": "^0.1.15",
|
|
40
|
+
"@bejibun/utils": "^0.1.1"
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -150,7 +150,7 @@ export default class RedisBuilder {
|
|
|
150
150
|
};
|
|
151
151
|
|
|
152
152
|
client.onclose = (error: Error) => {
|
|
153
|
-
|
|
153
|
+
Logger.setContext("Redis").warn(`Disconnected from "${name}" connection.`).trace(error);
|
|
154
154
|
this.emitter.emit("disconnect", name, error);
|
|
155
155
|
};
|
|
156
156
|
|
|
@@ -221,7 +221,7 @@ export default class RedisBuilder {
|
|
|
221
221
|
await RedisBuilder.disconnect();
|
|
222
222
|
Logger.setContext("Redis").warn(`Disconnected on "${defineValue(signal, "exit")}".`);
|
|
223
223
|
} catch (error: any) {
|
|
224
|
-
|
|
224
|
+
Logger.setContext("Redis").error("Error during disconnect.").trace(error);
|
|
225
225
|
} finally {
|
|
226
226
|
process.exit(0);
|
|
227
227
|
}
|