@sanghyuk-2i/huh-core
v0.1.1
Published
Huh - error content JSON DSL core: types, parsing, variable substitution, validation
Downloads
4
Maintainers
Readme
@sanghyuk-2i/huh-core
Core library for Huh - Manage error content in spreadsheets with type-safe runtime UI rendering.
Features
- 📋 JSON DSL: Parse error content from external data sources
- 🔄 Variable Substitution: Dynamic content with template variables
- ✅ Validation: Built-in schema validation with helpful error messages
- 🌍 i18n Support: Multi-language error content management
- 🔌 Plugin System: Extend with Sentry, Datadog, and custom integrations
- 📊 Severity Levels: Critical, high, medium, low error classification
Installation
npm install @sanghyuk-2i/huh-coreBasic Usage
import { parseSheetData, resolveError } from '@sanghyuk-2i/huh-core';
// Parse error configuration from data source
const errorConfig = parseSheetData(rows);
// Resolve error with variables
const resolved = resolveError(
errorConfig,
'AUTH_001',
{ username: 'john' }
);
console.log(resolved.message); // "User john not found"Framework Bindings
Use framework-specific packages for easier integration:
- React:
@sanghyuk-2i/huh-react - Vue:
@sanghyuk-2i/huh-vue - Svelte:
@sanghyuk-2i/huh-svelte
Documentation
License
MIT © sanghyuk-2i
