@flaghoist/adapter-memory 0.1.0 → 0.1.2

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 (2) hide show
  1. package/README.md +38 -0
  2. package/package.json +17 -2
package/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # @flaghoist/adapter-memory
2
+
3
+ Keep Flaghoist flags in memory. Useful for tests, local development, and anywhere you want a flag
4
+ server that starts clean every time.
5
+
6
+ ```bash
7
+ npm install @flaghoist/adapter-memory
8
+ ```
9
+
10
+ ```ts
11
+ import { memoryAdapter } from '@flaghoist/adapter-memory'
12
+ import { createFlagServer } from '@flaghoist/server'
13
+
14
+ const app = createFlagServer({
15
+ storage: memoryAdapter(),
16
+ auth: {/* ... */},
17
+ })
18
+ ```
19
+
20
+ You can seed it, which is what makes it pleasant in tests:
21
+
22
+ ```ts
23
+ memoryAdapter([{ key: 'new-checkout', enabled: true, rollout: { percentage: 100 }, rules: [] }])
24
+ ```
25
+
26
+ Everything disappears when the process exits. That is the point, but it does mean this is not the
27
+ one to reach for in production.
28
+
29
+ It is validated by the same conformance suite as the other adapters, so it behaves like the real
30
+ thing rather than like a stub that drifts.
31
+
32
+ ## Status
33
+
34
+ Pre-alpha, built and maintained by one person. The API can still change without notice, and
35
+ production use is not recommended yet. If you try it and something breaks, an issue is genuinely
36
+ useful.
37
+
38
+ 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-memory",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "In-memory StorageAdapter for Flaghoist — development, tests, and fallback defaults.",
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.0"
30
+ "@flaghoist/core": "0.1.2"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@flaghoist/adapter-conformance": "0.0.0"
@@ -35,6 +35,21 @@
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  },
38
+ "keywords": [
39
+ "feature-flags",
40
+ "storage",
41
+ "in-memory",
42
+ "testing"
43
+ ],
44
+ "repository": {
45
+ "type": "git",
46
+ "url": "git+https://github.com/flaghoist/flaghoist.git",
47
+ "directory": "packages/adapters/memory"
48
+ },
49
+ "homepage": "https://github.com/flaghoist/flaghoist#readme",
50
+ "bugs": {
51
+ "url": "https://github.com/flaghoist/flaghoist/issues"
52
+ },
38
53
  "scripts": {
39
54
  "build": "tsup src/index.ts --format esm,cjs --dts --clean",
40
55
  "test": "vitest run --passWithNoTests",