showwhat
v2.0.0
Published
A schema-based resolution engine for configuration and feature flags
Maintainers
Readme
showwhat
Feature flags and config you own. Platform-agnostic.
showwhat combines a YAML/JSON definition format with a schema-validated, extensible rule engine. Define flags and config as variations with conditions, evaluate them in your app, and store definitions wherever you want.
Installation
npm install showwhat
pnpm add showwhat
yarn add showwhat
# Other runtimes
bun add showwhat
deno install npm:showwhatQuick start
import { MemoryData, showwhat } from "showwhat";
const data = await MemoryData.fromObject({
definitions: {
checkout_v2: {
variations: [{ value: true, conditions: [{ type: "env", value: "prod" }] }, { value: false }],
},
},
});
const results = await showwhat({
keys: ["checkout_v2"],
context: { env: "prod" },
options: { data },
});
console.log(results.checkout_v2.value); // trueFeatures
showwhat()resolution engine for flags and config values- Built-in condition evaluators:
string,number,datetime,bool,env,startAt,endAt - Custom evaluators via
registerEvaluators() - YAML and JSON parsing with schema validation
- Pluggable data sources (
DefinitionReader/DefinitionWriter) - Typed error hierarchy
Documentation
- Quick Start — installation and first definition
- Conditions — built-in condition types and usage
- Context — runtime context object
- Definitions — definition structure and variations
- Core API —
showwhat(),resolve(), parsing, and more - Errors — error types and when they are thrown
- Custom Conditions — writing your own evaluators
- Custom Data Sources — implementing
DefinitionReader - MemoryData — in-memory data source
