deepbase-redis 1.0.12 → 1.0.16

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.
Files changed (3) hide show
  1. package/README.md +5 -5
  2. package/index.mjs +2 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -31,8 +31,8 @@ console.log(configLang); // "en"
31
31
  ```js
32
32
  const path = await mem.add("user", { name: "martin" });
33
33
 
34
- // add() will create a secure key (ie. "iKid4OCK")
35
- console.log(path) // [ 'user', 'iKid4OCK' ]
34
+ // add() will create a secure key (ie. "CqtOILTDUg")
35
+ console.log(path) // [ 'user', 'CqtOILTDUg' ]
36
36
 
37
37
  const userName = await mem.get(...path, "name");
38
38
  console.log(userName); // "martin"
@@ -58,14 +58,14 @@ const lang = await mem.get("config", "lang"); // EN
58
58
  await mem.add("user", { name: "anya" });
59
59
 
60
60
  const userIds = await mem.keys("user")
61
- console.log(userIds) // [ 'iKid4OCKds', 'F3wORv_Jsd' ]
61
+ console.log(userIds) // [ 'CqtOILTDUg', 'MXOlTBSmEf' ]
62
62
 
63
63
  console.log(await mem.get())
64
64
  // {
65
65
  // config: { lang: 'EN' },
66
66
  // user: {
67
- // iKid4OCKds: { name: 'martin', balance: 580 },
68
- // F3wORv_Jsd: { name: 'anya' }
67
+ // CqtOILTDUg: { name: 'martin', balance: 580 },
68
+ // MXOlTBSmEf: { name: 'anya' }
69
69
  // }
70
70
  // }
71
71
  ```
package/index.mjs CHANGED
@@ -8,10 +8,9 @@ export default class DeepBaseRedis {
8
8
  this.nidLength = 10;
9
9
  this.name = "db";
10
10
  this.url = "redis://localhost:6379";
11
- Object.assign(this, opts)
12
-
13
- this.nanoid = customAlphabet(this.nidAlphabet, this.nidLength)
14
11
  this.client = createClient({ url: this.url });
12
+ this.nanoid = customAlphabet(this.nidAlphabet, this.nidLength)
13
+ Object.assign(this, opts)
15
14
  }
16
15
 
17
16
  async disconnect() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepbase-redis",
3
- "version": "1.0.12",
3
+ "version": "1.0.16",
4
4
  "description": "⚡ Fastest and simplest way to add Redis Stack persistence to your projects.",
5
5
  "main": "index.mjs",
6
6
  "dependencies": {