@tomsd/redis-client 1.0.1 → 1.0.3

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/README.md CHANGED
@@ -3,6 +3,19 @@
3
3
  It's a wrapper of [ioredis](https://www.npmjs.com/package/ioredis).
4
4
  See [redis-client.netlify.app](https://redis-client.netlify.app/) also.
5
5
 
6
+ ![npm](https://img.shields.io/npm/v/@tomsd/redis-client?style=for-the-badge&logo=npm)
7
+ ![NPM](https://img.shields.io/npm/l/@tomsd/redis-client?style=for-the-badge&logo=npm)
8
+ ![release date](https://img.shields.io/github/release-date/tomsdoo/redis-client?style=for-the-badge&logo=npm)
9
+ ![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/npm/@tomsd/redis-client?style=for-the-badge&logo=npm)
10
+
11
+ ![ci](https://img.shields.io/github/actions/workflow/status/tomsdoo/redis-client/ci.yml?style=social&logo=github)
12
+ ![checks](https://img.shields.io/github/check-runs/tomsdoo/redis-client/main?style=social&logo=github)
13
+ ![top language](https://img.shields.io/github/languages/top/tomsdoo/redis-client?style=social&logo=typescript)
14
+ ![Maintenance](https://img.shields.io/maintenance/yes/2024?style=social&logo=github)
15
+ ![depends on ioredis@5](https://img.shields.io/badge/ioredis-ioredis@5-informational?style=social&logo=redis)
16
+ ![depends on node greater or equal 18](https://img.shields.io/badge/node.js-%3E%3D%2018-lightyellow?style=social&logo=nodedotjs)
17
+
18
+
6
19
  ## Installation
7
20
 
8
21
  ``` shell
package/dist/cjs/index.js CHANGED
@@ -48,7 +48,7 @@ class Redis {
48
48
  [this.keyProp]: (0, uuid_1.v4)(),
49
49
  ...value,
50
50
  };
51
- // @ts-expect-error
51
+ // @ts-expect-error prop name
52
52
  const key = savingObj[this.keyProp];
53
53
  return this.expireSeconds !== undefined
54
54
  ? await redis
@@ -1,4 +1,4 @@
1
- import IORedis, { RedisOptions } from "ioredis";
1
+ import IORedis, { type RedisOptions } from "ioredis";
2
2
  interface EasyRedisConfig {
3
3
  keyProp?: string;
4
4
  expireSeconds?: number;
package/dist/esm/index.js CHANGED
@@ -27,8 +27,8 @@ export class Redis {
27
27
  return this.redis;
28
28
  }
29
29
  getKeys() {
30
- var _a, _b, _c;
31
30
  return __awaiter(this, void 0, void 0, function* () {
31
+ var _a, _b, _c;
32
32
  const keyFilter = `${(_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.keyPrefix) !== null && _c !== void 0 ? _c : ""}*`;
33
33
  const sliceKey = (s) => { var _a, _b, _c, _d; return s.slice((_d = (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.keyPrefix) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0); };
34
34
  return yield this.getRedis()
@@ -53,7 +53,7 @@ export class Redis {
53
53
  const redis = this.getRedis();
54
54
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
55
55
  const savingObj = Object.assign({ [this.keyProp]: uuid() }, value);
56
- // @ts-expect-error
56
+ // @ts-expect-error prop name
57
57
  const key = savingObj[this.keyProp];
58
58
  return this.expireSeconds !== undefined
59
59
  ? yield redis
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "@tomsd/redis-client",
3
- "version": "1.0.1",
4
- "description": "It's a wrapper of uiredis.",
3
+ "version": "1.0.3",
4
+ "description": "It's a wrapper of ioredis.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
7
7
  "types": "dist/esm/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
8
11
  "scripts": {
9
12
  "build": "tsc --project tsconfig.cjs.json && tsc --project tsconfig.esm.json",
10
13
  "format": "npm run format:src && npm run format:test",
@@ -13,11 +16,9 @@
13
16
  "lint": "npm run lint:src && npm run lint:test",
14
17
  "lint:src": "eslint src/**/*.ts",
15
18
  "lint:test": "eslint __test__/**/*.ts",
16
- "prepare": "husky install",
17
- "start-redis": "npm run build-redis && npm run serve-redis",
18
- "build-redis": "docker image build -f Dockerfile -t redis-alpine-image:v1.0.0 .",
19
- "serve-redis": "docker run --name redis-alpine-instance -p 6379:6379 --rm -d redis-alpine-image:v1.0.0",
20
- "stop-redis": "docker container stop redis-alpine-instance",
19
+ "prepare": "husky",
20
+ "start-redis": "docker run --rm -d -p 6379:6379 --name redis-instance redis:alpine",
21
+ "stop-redis": "docker container stop redis-instance",
21
22
  "serve:doc": "mdbook --serve --directory docs",
22
23
  "test": "jest"
23
24
  },
@@ -45,28 +46,27 @@
45
46
  },
46
47
  "homepage": "https://github.com/tomsdoo/redis-client#readme",
47
48
  "devDependencies": {
48
- "@babel/core": "^7.20.12",
49
- "@babel/preset-env": "^7.20.2",
50
- "@babel/preset-typescript": "^7.18.6",
51
- "@tomsd/md-book": "^1.0.2",
52
- "@types/uuid": "^9.0.0",
53
- "@typescript-eslint/eslint-plugin": "^5.48.0",
54
- "babel-jest": "^29.3.1",
55
- "eslint": "^8.31.0",
56
- "eslint-config-prettier": "^8.6.0",
57
- "eslint-config-standard-with-typescript": "^26.0.0",
58
- "eslint-plugin-import": "^2.26.0",
59
- "eslint-plugin-n": "^15.6.0",
60
- "eslint-plugin-promise": "^6.1.1",
61
- "husky": "^8.0.3",
62
- "jest": "^29.3.1",
63
- "lint-staged": "^13.1.0",
64
- "prettier": "^2.8.2",
65
- "ts-node": "^10.9.1",
66
- "typescript": "^4.9.4"
49
+ "@babel/core": "7.26.0",
50
+ "@babel/preset-env": "7.26.0",
51
+ "@babel/preset-typescript": "7.26.0",
52
+ "@tomsd/md-book": "1.3.3",
53
+ "@types/uuid": "10.0.0",
54
+ "@typescript-eslint/eslint-plugin": "8.16.0",
55
+ "babel-jest": "29.7.0",
56
+ "eslint": "8.57.1",
57
+ "eslint-config-prettier": "9.1.0",
58
+ "eslint-plugin-import": "2.31.0",
59
+ "eslint-plugin-n": "17.14.0",
60
+ "eslint-plugin-promise": "7.2.1",
61
+ "husky": "9.1.7",
62
+ "jest": "29.7.0",
63
+ "lint-staged": "15.2.10",
64
+ "prettier": "3.4.1",
65
+ "ts-node": "10.9.2",
66
+ "typescript": "5.7.2"
67
67
  },
68
68
  "dependencies": {
69
- "ioredis": "^5.2.4",
70
- "uuid": "^9.0.0"
69
+ "ioredis": "5.4.1",
70
+ "uuid": "11.0.3"
71
71
  }
72
72
  }