npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@kiqjs/yaml

v0.1.2

Published

YAML configuration templates and helpers for KiqJS applications with server configuration defaults

Readme

@kiqjs/yaml

YAML configuration templates and helpers for KiqJS applications with server configuration defaults.

Features

  • Default Configuration Templates: Ready-to-use YAML configuration files
  • Profile-based Configs: Development and production profile templates
  • Type-safe Helpers: TypeScript functions to access common configurations
  • Server Config: Pre-configured server settings (port, host, prefix)
  • Logging Config: Standard logging configuration structure
  • Feature Flags: Built-in support for feature flag patterns

Installation

pnpm add @kiqjs/yaml

Quick Start

1. Copy Configuration Templates

Copy the template configuration files to your project's resources/ folder:

# From packages/yaml/resources/ to your-project/resources/
cp -r node_modules/@kiqjs/yaml/resources/*.yml resources/

This will give you:

  • application.yml - Base configuration
  • application-development.yml - Development overrides
  • application-production.yml - Production overrides

2. Use Configuration Helpers

import { getServerConfig, getAppConfig, getLoggingConfig } from '@kiqjs/yaml';

// Get server configuration
const serverConfig = getServerConfig();
console.log(`Server: ${serverConfig.host}:${serverConfig.port}`);
// Output: Server: localhost:3000

// Get app metadata
const appConfig = getAppConfig();
console.log(`${appConfig.name} v${appConfig.version}`);
// Output: KiqJS Application v1.0.0

// Get logging configuration
const loggingConfig = getLoggingConfig();
if (loggingConfig.pretty) {
  console.log('Using pretty logging format');
}

3. Use with HTTP Server

import { KiqHttpApplication } from '@kiqjs/http';
import { getServerConfig } from '@kiqjs/yaml';

const app = new KiqHttpApplication();

const serverConfig = getServerConfig();

app.start(serverConfig.port, serverConfig.host).then(() => {
  console.log(`Server running at http://${serverConfig.host}:${serverConfig.port}`);
});

Default Configuration Structure

Base Configuration (application.yml)

# Active profiles
kiq:
  profiles:
    active: development

# Server configuration
server:
  port: 3000
  host: localhost
  prefix: /api

# Application metadata
app:
  name: KiqJS Application
  version: 1.0.0
  description: KiqJS application with default configuration

# Logging
logging:
  level: info
  format: json
  pretty: false

# Feature flags
features:
  enabled: true

Development Profile (application-development.yml)

  • Port: 3000
  • Host: localhost
  • Logging: debug, pretty format
  • Features: enabled

Production Profile (application-production.yml)

  • Port: 8080
  • Host: 0.0.0.0
  • Logging: warn, json format
  • Features: enabled

API Reference

getServerConfig(): ServerConfig

Returns server configuration from YAML:

interface ServerConfig {
  port: number;      // Default: 3000
  host: string;      // Default: 'localhost'
  prefix?: string;   // Default: undefined
}

getAppConfig(): AppConfig

Returns application metadata from YAML:

interface AppConfig {
  name: string;        // Default: 'KiqJS Application'
  version: string;     // Default: '1.0.0'
  description?: string;
}

getLoggingConfig(): LoggingConfig

Returns logging configuration from YAML:

interface LoggingConfig {
  level: 'debug' | 'info' | 'warn' | 'error';  // Default: 'info'
  format: 'json' | 'pretty';                   // Default: 'json'
  pretty?: boolean;                            // Default: false
}

isFeatureEnabled(featureName: string, defaultValue?: boolean): boolean

Checks if a feature flag is enabled:

if (isFeatureEnabled('features.newUI', false)) {
  // Enable new UI
}

Customization

You can customize the configuration files after copying them to your project:

# resources/application.yml
server:
  port: 4000              # Change port
  host: 0.0.0.0          # Change host
  prefix: /api/v2        # Add API prefix

app:
  name: My Awesome App   # Your app name
  version: 2.0.0

features:
  newFeature: true       # Add custom feature flags
  beta: false

Environment Variables

You can override any configuration value with environment variables:

SERVER_PORT=5000 node dist/index.js

The naming convention is uppercase with underscores, replacing dots:

  • server.portSERVER_PORT
  • logging.levelLOGGING_LEVEL
  • app.nameAPP_NAME

Profiles

Switch between profiles using:

  1. YAML configuration:
kiq:
  profiles:
    active: production
  1. Environment variable:
NODE_ENV=production node dist/index.js

License

MIT