@flaghoist/adapter-redis 0.1.0 → 0.1.1
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 +44 -0
- package/package.json +18 -2
package/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# @flaghoist/adapter-redis
|
|
2
|
+
|
|
3
|
+
Store Flaghoist flags in Redis. Works with ioredis on Node and with Upstash on the edge, because it
|
|
4
|
+
only needs a client that can get, set, delete and scan.
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
npm install @flaghoist/adapter-redis
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
On Node with ioredis:
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
import { redisAdapter } from '@flaghoist/adapter-redis'
|
|
14
|
+
import { Redis } from 'ioredis'
|
|
15
|
+
|
|
16
|
+
createFlagServer({
|
|
17
|
+
storage: redisAdapter(new Redis(process.env.REDIS_URL)),
|
|
18
|
+
auth: {/* ... */},
|
|
19
|
+
})
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
On Cloudflare Workers with Upstash, where a TCP connection is not an option:
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { Redis } from '@upstash/redis/cloudflare'
|
|
26
|
+
|
|
27
|
+
createFlagServer((env) => ({
|
|
28
|
+
storage: redisAdapter(Redis.fromEnv(env)),
|
|
29
|
+
auth: {/* ... */},
|
|
30
|
+
}))
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Pick this over Cloudflare KV when you want changes to be visible immediately everywhere, rather than
|
|
34
|
+
a few seconds later. Pick KV when you would rather not run anything.
|
|
35
|
+
|
|
36
|
+
Validated by the same conformance suite as the other adapters.
|
|
37
|
+
|
|
38
|
+
## Status
|
|
39
|
+
|
|
40
|
+
Pre-alpha, built and maintained by one person. The API can still change without notice, and
|
|
41
|
+
production use is not recommended yet. If you try it and something breaks, an issue is genuinely
|
|
42
|
+
useful.
|
|
43
|
+
|
|
44
|
+
Apache-2.0. Part of [Flaghoist](https://github.com/flaghoist/flaghoist).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flaghoist/adapter-redis",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Redis StorageAdapter for Flaghoist — works with ioredis (Node) and Upstash (edge).",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"node": ">=20"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@flaghoist/core": "0.1.
|
|
30
|
+
"@flaghoist/core": "0.1.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@flaghoist/adapter-conformance": "0.0.0"
|
|
@@ -35,6 +35,22 @@
|
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
|
+
"keywords": [
|
|
39
|
+
"feature-flags",
|
|
40
|
+
"storage",
|
|
41
|
+
"redis",
|
|
42
|
+
"ioredis",
|
|
43
|
+
"upstash"
|
|
44
|
+
],
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "git+https://github.com/flaghoist/flaghoist.git",
|
|
48
|
+
"directory": "packages/adapters/redis"
|
|
49
|
+
},
|
|
50
|
+
"homepage": "https://github.com/flaghoist/flaghoist#readme",
|
|
51
|
+
"bugs": {
|
|
52
|
+
"url": "https://github.com/flaghoist/flaghoist/issues"
|
|
53
|
+
},
|
|
38
54
|
"scripts": {
|
|
39
55
|
"build": "tsup src/index.ts --format esm,cjs --dts --clean",
|
|
40
56
|
"test": "vitest run --passWithNoTests",
|