@quonfig/node 0.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Quonfig
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,64 @@
1
+ # @quonfig/node
2
+
3
+ Node.js SDK for [Quonfig](https://quonfig.com) — Feature Flags, Live Config, and Dynamic Log Levels.
4
+
5
+ > **Note:** This SDK is pre-1.0 and the API is not yet stable.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install @quonfig/node
11
+ ```
12
+
13
+ ## Quick Start
14
+
15
+ ```typescript
16
+ import { Quonfig } from "@quonfig/node";
17
+
18
+ const quonfig = new Quonfig({ sdkKey: "your-sdk-key" });
19
+ await quonfig.init();
20
+
21
+ // Feature flags
22
+ if (quonfig.isFeatureEnabled("new-dashboard")) {
23
+ // show new dashboard
24
+ }
25
+
26
+ // Config values
27
+ const limit = quonfig.getNumber("rate-limit");
28
+ const regions = quonfig.getStringList("allowed-regions");
29
+
30
+ // Context-aware evaluation
31
+ const value = quonfig.get("homepage-hero", {
32
+ user: { key: "user-123", country: "US" },
33
+ });
34
+
35
+ // Bound context for repeated lookups
36
+ const userClient = quonfig.inContext({
37
+ user: { key: "user-123", plan: "pro" },
38
+ });
39
+ userClient.get("feature-x");
40
+ userClient.isFeatureEnabled("beta-feature");
41
+
42
+ // Clean up when done
43
+ quonfig.close();
44
+ ```
45
+
46
+ ## Options
47
+
48
+ ```typescript
49
+ new Quonfig({
50
+ sdkKey: "your-sdk-key", // Required
51
+ apiUrl: "https://api.quonfig.com", // API endpoint (default)
52
+ enableSSE: true, // Real-time updates via SSE (default: true)
53
+ enablePolling: false, // Polling fallback (default: false)
54
+ pollInterval: 60000, // Polling interval in ms (default: 60000)
55
+ initTimeout: 10000, // Init timeout in ms (default: 10000)
56
+ onNoDefault: "error", // "error" | "warn" | "ignore" (default: "error")
57
+ globalContext: { ... }, // Context applied to all evaluations
58
+ datafile: "./config.json", // Load from file instead of API
59
+ });
60
+ ```
61
+
62
+ ## License
63
+
64
+ MIT