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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@chittyos/config

v1.0.1

Published

Service configuration and URL management for ChittyOS Framework

Readme

@chittyos/config

Service configuration and URL management for ChittyOS Framework.

Installation

npm install @chittyos/config

Usage

Load ChittyOS Configuration

import { loadChittyOSConfig } from '@chittyos/config';

// Load production configuration
const config = loadChittyOSConfig({ environment: 'production' });

console.log(config.services.chittyid);      // https://id.chitty.cc
console.log(config.services.chittyauth);    // https://auth.chitty.cc
console.log(config.environment);            // 'production'

Environment-Specific Configuration

import { loadChittyOSConfig } from '@chittyos/config';

// Development environment
const devConfig = loadChittyOSConfig({ environment: 'development' });
console.log(devConfig.services.chittyid);  // https://dev-id.chitty.cc

// Staging environment
const stagingConfig = loadChittyOSConfig({ environment: 'staging' });
console.log(stagingConfig.services.chittyid);  // https://staging-id.chitty.cc

// Local development with localhost URLs
const localConfig = loadChittyOSConfig({
  environment: 'development',
  localDev: true
});
console.log(localConfig.services.chittyid);  // http://localhost:8701

Get Individual Service URLs

import { getServiceURL } from '@chittyos/config';

// Get service URL for current environment
const chittyidURL = getServiceURL('chittyid');

// Get service URL with custom config
const authURL = getServiceURL('chittyauth', {
  environment: 'staging'
});

Custom Service URLs

import { loadChittyOSConfig } from '@chittyos/config';

// Override specific service URL
const config = loadChittyOSConfig({
  services: {
    chittyid: 'https://my-custom-id.example.com',
  },
});

// Override with environment-specific URLs
const config2 = loadChittyOSConfig({
  services: {
    chittyid: {
      production: 'https://prod-id.example.com',
      staging: 'https://stage-id.example.com',
      development: 'https://dev-id.example.com',
      local: 'http://localhost:9000',
    },
  },
});

Service Configuration Objects

import { createServiceConfig } from '@chittyos/config';

// Create service configuration
const serviceConfig = createServiceConfig('chittyid');

console.log(serviceConfig);
// {
//   name: 'chittyid',
//   baseURL: 'https://id.chitty.cc',
//   healthEndpoint: 'https://id.chitty.cc/health',
//   version: '1.0.0',
//   environment: 'production'
// }

Service Validation

import { validateServiceURL, validateAllServices } from '@chittyos/config';

// Validate single service URL
const isValid = await validateServiceURL('https://id.chitty.cc');
console.log(isValid);  // true if service is reachable

// Validate all configured services
const results = await validateAllServices();
console.log(results);
// {
//   chittyid: true,
//   chittyauth: true,
//   chittyschema: false,
//   ...
// }

Configuration Presets

import { configPresets } from '@chittyos/config';

// Production configuration
const prodConfig = configPresets.production();

// Staging configuration
const stagingConfig = configPresets.staging();

// Development configuration
const devConfig = configPresets.development();

// Local development (localhost URLs)
const localConfig = configPresets.local();

// Minimal configuration (ChittyID only)
const minimalConfig = configPresets.minimal();
console.log(minimalConfig.services);  // { chittyid: 'https://id.chitty.cc' }

Service Discovery

import {
  isServiceConfigured,
  getConfiguredServices
} from '@chittyos/config';

// Check if service is configured
if (isServiceConfigured('chittyid')) {
  console.log('ChittyID service is configured');
}

// Get all configured services
const services = getConfiguredServices();
console.log(services);  // ['chittyid', 'chittyauth', 'chittyschema', ...]

ChittyOS Services

| Service | Production URL | Default Port | |---------|---------------|--------------| | chittyid | https://id.chitty.cc | 8701 | | chittyauth | https://auth.chitty.cc | 8702 | | chittyschema | https://schema.chitty.cc | 8703 | | chittyrouter | https://router.chitty.cc | 8704 | | chittychat | https://chat.chitty.cc | 8705 | | chittyregistry | https://registry.chitty.cc | 8706 | | chittycanon | https://canon.chitty.cc | 8707 | | chittygateway | https://gateway.chitty.cc | 8708 | | chittysync | https://sync.chitty.cc | 8709 | | chittyverify | https://verify.chitty.cc | 8710 |

Environment Variables

Override service URLs with environment variables:

# Override ChittyID service URL
CHITTYID_SERVICE=https://custom-id.example.com

# Override ChittyAuth service URL
CHITTYAUTH_SERVICE=https://custom-auth.example.com

# Override ChittySchema service URL
CHITTYSCHEMA_SERVICE=https://custom-schema.example.com

# Override Registry service URL
REGISTRY_SERVICE=https://custom-registry.example.com

# Override Gateway service URL
GATEWAY_SERVICE=https://custom-gateway.example.com

Configuration Priority

Service URLs are resolved in the following order (highest priority first):

  1. Custom URL override - Explicitly passed in services config
  2. Environment variable - CHITTYID_SERVICE, CHITTYAUTH_SERVICE, etc.
  3. Default URLs - Built-in environment-specific defaults

Advanced Configuration

Fallback to Production

import { loadChittyOSConfig } from '@chittyos/config';

// Disable fallback to production URLs
const config = loadChittyOSConfig({
  environment: 'staging',
  fallbackToProduction: false,  // Throw error if staging URL missing
});

Service Health Check

import { validateServiceURL } from '@chittyos/config';

// Custom timeout (default: 5000ms)
const isValid = await validateServiceURL(
  'https://id.chitty.cc',
  3000  // 3 second timeout
);

Features

  • ✅ Environment-aware configuration (dev/staging/production)
  • ✅ Local development mode with localhost URLs
  • ✅ Environment variable overrides
  • ✅ Custom service URL configuration
  • ✅ Service validation and health checks
  • ✅ Configuration presets for common scenarios
  • ✅ Service discovery utilities
  • ✅ Type-safe service identifiers
  • ✅ Zero runtime dependencies (except @chittyos/types and @chittyos/env)

Package Size

~28KB (gzipped)

License

MIT