{"id":45278209,"url":"https://github.com/ersinkoc/config","last_synced_at":"2026-02-21T02:04:14.573Z","repository":{"id":333100398,"uuid":"1127605902","full_name":"ersinkoc/Config","owner":"ersinkoc","description":"      Zero-dependency configuration loader with multi-format support and plugin extensibility","archived":false,"fork":false,"pushed_at":"2026-01-17T12:09:08.000Z","size":379,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-17T20:26:14.194Z","etag":null,"topics":["config","env","ini","json","toml","yaml"],"latest_commit_sha":null,"homepage":"http://config.oxog.dev/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ersinkoc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-04T08:22:51.000Z","updated_at":"2026-01-17T12:09:12.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ersinkoc/Config","commit_stats":null,"previous_names":["ersinkoc/config"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ersinkoc/Config","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ersinkoc%2FConfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ersinkoc%2FConfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ersinkoc%2FConfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ersinkoc%2FConfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ersinkoc","download_url":"https://codeload.github.com/ersinkoc/Config/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ersinkoc%2FConfig/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29671513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T00:11:43.526Z","status":"online","status_checked_at":"2026-02-21T02:00:07.432Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["config","env","ini","json","toml","yaml"],"created_at":"2026-02-21T02:04:01.251Z","updated_at":"2026-02-21T02:04:14.565Z","avatar_url":"https://github.com/ersinkoc.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @oxog/config\n\nZero-dependency configuration loader with multi-format support and plugin extensibility.\n\n[![npm version](https://img.shields.io/npm/v/@oxog/config.svg)](https://www.npmjs.com/package/@oxog/config)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Node.js](https://img.shields.io/badge/node-%3E%3D18-brightgreen.svg)](https://nodejs.org/)\n\n## Features\n\n- **Multi-format support** - JSON, YAML, TOML, INI, ENV out of the box\n- **Zero dependencies** - Pure TypeScript implementation\n- **Type-safe** - Full TypeScript support with generics\n- **Plugin system** - Micro-kernel architecture for extensibility\n- **Environment overrides** - Automatic environment-based configuration\n- **Deep merging** - Multiple merge strategies (replace, merge, append, prepend, unique)\n- **Hot reload** - File watching with debouncing\n- **Encryption** - AES-256-GCM for sensitive values\n- **Validation** - JSON Schema support\n\n## Installation\n\n```bash\nnpm install @oxog/config\n```\n\n## Quick Start\n\n```typescript\nimport { loadConfig } from '@oxog/config';\n\nconst config = await loadConfig({\n  name: 'myapp',\n  paths: ['./config.yaml'],\n  env: process.env.NODE_ENV || 'development',\n});\n\n// Access values\nconst port = config.get('port');\nconst dbHost = config.get('database.host');\n```\n\n### Type-Safe Configuration\n\n```typescript\ninterface AppConfig {\n  port: number;\n  database: {\n    host: string;\n    port: number;\n  };\n}\n\nconst config = await loadConfig\u003cAppConfig\u003e({ name: 'myapp' });\nconst port: number = config.get('port'); // Type-safe!\n```\n\n## Supported Formats\n\n### JSON\n```json\n{\n  \"port\": 3000,\n  \"database\": { \"host\": \"localhost\", \"port\": 5432 }\n}\n```\n\n### YAML\n```yaml\nport: 3000\ndatabase:\n  host: localhost\n  port: 5432\n```\n\n### TOML\n```toml\nport = 3000\n\n[database]\nhost = \"localhost\"\nport = 5432\n```\n\n### INI\n```ini\nport = 3000\n\n[database]\nhost = localhost\nport = 5432\n```\n\n### ENV\n```env\nPORT=3000\nDATABASE_HOST=localhost\nDATABASE_PORT=5432\n```\n\n## Environment Overrides\n\nAutomatically loads environment-specific configurations:\n\n```\nconfig.yaml              # Base config\nconfig.development.yaml  # Development overrides\nconfig.production.yaml   # Production overrides\nconfig.local.yaml        # Local overrides (gitignored)\n.env                     # Environment variables\n```\n\n## Merge Strategies\n\n```typescript\nconst config = await loadConfig({\n  name: 'myapp',\n  mergeStrategy: {\n    default: 'merge',\n    arrays: 'unique',\n    paths: {\n      'server.plugins': 'append',\n    },\n  },\n});\n```\n\n## Plugins\n\n### Core Plugins (Always Loaded)\n- `json-parser` - JSON format support\n- `env-parser` - ENV format and environment variables\n- `merge` - Configuration merging\n- `defaults` - Default values and validation\n\n### Optional Plugins\n\n```typescript\nimport { validationPlugin, yamlParserPlugin } from '@oxog/config/plugins';\n\nconst config = await loadConfig({ name: 'myapp' });\n\n// Add YAML support\nconfig.use(yamlParserPlugin());\n\n// Add schema validation\nconfig.use(validationPlugin({\n  schema: {\n    type: 'object',\n    properties: {\n      port: { type: 'number', minimum: 1, maximum: 65535 },\n    },\n    required: ['port'],\n  },\n}));\n```\n\n## API Reference\n\n### loadConfig(options)\n\n```typescript\ninterface LoadOptions {\n  name: string;              // Application name\n  paths?: string[];          // Config file paths\n  cwd?: string;              // Base directory\n  env?: string;              // Current environment\n  environments?: string[];   // Supported environments\n  envPrefix?: string;        // Env var prefix\n  defaults?: object;         // Default values\n  required?: string[];       // Required field paths\n  mergeStrategy?: object;    // Merge strategies\n  watch?: boolean;           // Enable file watching\n  plugins?: ConfigPlugin[];  // Plugins to use\n}\n```\n\n### Config Instance\n\n| Method | Description |\n|--------|-------------|\n| `get(path, default?)` | Get value at path |\n| `set(path, value)` | Set value at path |\n| `has(path)` | Check if path exists |\n| `delete(path)` | Delete value at path |\n| `toObject()` | Get all config as object |\n| `reload()` | Reload from files |\n| `watch()` | Start file watching |\n| `unwatch()` | Stop file watching |\n| `use(plugin)` | Register plugin |\n| `on(event, handler)` | Register event listener |\n| `off(event, handler)` | Remove event listener |\n\n## Bundle Size\n\n| Package | Size |\n|---------|------|\n| Core | ~5KB gzipped |\n| With all plugins | ~15KB gzipped |\n\n**Zero runtime dependencies**\n\n## Documentation\n\nVisit [config.oxog.dev](https://config.oxog.dev) for full documentation.\n\n## License\n\nMIT\n\n## Author\n\nErsin Koc ([@ersinkoc](https://github.com/ersinkoc))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fersinkoc%2Fconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fersinkoc%2Fconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fersinkoc%2Fconfig/lists"}