@foolishandi_tech/config
v0.1.4
Published
Configuration management for One Tech project
Readme
@foolishandi_tech/config
Configuration management for One Tech project.
Installation
npm install @foolishandi_tech/config
# or
yarn add @foolishandi_tech/config
# or
pnpm add @foolishandi_tech/configUsage
import { loadConfig, getServiceMode, isCloudMode } from '@foolishandi_tech/config';
// Load configuration
const config = await loadConfig();
// Get service mode
const mode = await getServiceMode();
// Check if cloud mode is enabled
const isCloud = await isCloudMode();API
loadConfig(): Promise<AppConfig>
Load application configuration from Rust backend. Results are cached.
getConfig(): AppConfig | null
Get cached configuration synchronously. Returns null if config hasn't been loaded yet.
clearConfigCache(): void
Clear the configuration cache.
getServiceMode(): Promise<ServiceMode>
Get the current service mode ('local' | 'cloud').
isCloudMode(): Promise<boolean>
Check if cloud service mode is enabled.
isLocalMode(): Promise<boolean>
Check if local service mode is enabled.
getCloudConfig()
Get cloud service configuration.
getLocalConfig()
Get local service configuration.
getUIConfig()
Get UI configuration.
getSecurityConfig()
Get security configuration.
Development
# Build
npm run build
# Watch mode
npm run dev
# Clean
npm run clean