{"id":29436880,"url":"https://github.com/stone-foundation/stone-js-config","last_synced_at":"2026-03-14T00:42:41.687Z","repository":{"id":196569241,"uuid":"696298302","full_name":"stone-foundation/stone-js-config","owner":"stone-foundation","description":"Fluent and simple API with string deep dot access to manage configurations in any JavaScript/TypeScript project","archived":false,"fork":false,"pushed_at":"2025-06-12T02:52:13.000Z","size":205,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-12T03:40:00.168Z","etag":null,"topics":["context-aware","continuum-architecture","javascript","official-stonejs","stone-foundation","stonejs","stonejs-blueprint","stonejs-core","typescript"],"latest_commit_sha":null,"homepage":"https://stonejs.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/stone-foundation.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-09-25T13:32:38.000Z","updated_at":"2025-06-12T02:51:06.000Z","dependencies_parsed_at":"2024-03-31T14:05:16.785Z","dependency_job_id":"9cc24f46-143a-4daf-917d-8f5df61fff56","html_url":"https://github.com/stone-foundation/stone-js-config","commit_stats":null,"previous_names":["stonemjs/configuration-manager","stonemjs/config","stone-foundation/stone-js-config"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/stone-foundation/stone-js-config","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stone-foundation%2Fstone-js-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stone-foundation%2Fstone-js-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stone-foundation%2Fstone-js-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stone-foundation%2Fstone-js-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stone-foundation","download_url":"https://codeload.github.com/stone-foundation/stone-js-config/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stone-foundation%2Fstone-js-config/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265091734,"owners_count":23710033,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["context-aware","continuum-architecture","javascript","official-stonejs","stone-foundation","stonejs","stonejs-blueprint","stonejs-core","typescript"],"created_at":"2025-07-13T05:06:55.949Z","updated_at":"2026-03-14T00:42:41.681Z","avatar_url":"https://github.com/stone-foundation.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stone.js - Config\n\n[![npm](https://img.shields.io/npm/l/@stone-js/config)](https://opensource.org/licenses/MIT)\n[![npm](https://img.shields.io/npm/v/@stone-js/config)](https://www.npmjs.com/package/@stone-js/config)\n[![npm](https://img.shields.io/npm/dm/@stone-js/config)](https://www.npmjs.com/package/@stone-js/config)\n![Maintenance](https://img.shields.io/maintenance/yes/2025)\n[![Build Status](https://github.com/stone-foundation/stone-js-config/actions/workflows/main.yml/badge.svg)](https://github.com/stone-foundation/stone-js-config/actions/workflows/main.yml)\n[![Publish Package to npmjs](https://github.com/stone-foundation/stone-js-config/actions/workflows/release.yml/badge.svg)](https://github.com/stone-foundation/stone-js-config/actions/workflows/release.yml)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=stone-foundation_stone-js-config\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=stone-foundation_stone-js-config)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=stone-foundation_stone-js-config\u0026metric=coverage)](https://sonarcloud.io/summary/new_code?id=stone-foundation_stone-js-config)\n[![Security Policy](https://img.shields.io/badge/Security-Policy-blue.svg)](./SECURITY.md)\n[![CodeQL](https://github.com/stone-foundation/stone-js-config/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/stone-foundation/stone-js-config/security/code-scanning)\n[![Dependabot Status](https://img.shields.io/badge/Dependabot-enabled-brightgreen.svg)](https://github.com/stone-foundation/stone-js-config/network/updates)\n[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)\n\nFluent and type-safe configuration management with deep property access, merging, and dynamic proxy fallback.\n\n---\n\n## Overview\n\n`@stone-js/config` provides a smart, fluent API to manage application settings in any JavaScript or TypeScript project.\n\n- Deep property access (`config.get('nested.key')`)\n- Automatic fallback via Proxy (`config.someKey`)\n- Merge strategies for objects and arrays\n- Default value support, `get('name', 'fallback')`\n- Fully tested with 100% coverage\n\n## Installation\n\nInstall using your preferred package manager:\n\n```bash\nnpm i @stone-js/config\n# or\nyarn add @stone-js/config\n# or\npnpm add @stone-js/config\n```\n\n\u003e \\[!IMPORTANT]\n\u003e This package is **pure ESM**. Ensure your `package.json` includes `\"type\": \"module\"` or configure your bundler appropriately.\n\n```ts\nimport { Config } from '@stone-js/config'\n```\n\n## Getting Started\n\n### Create a Config instance\n\n```ts\nconst config = Config.create({\n  app: { name: 'MyApp', env: 'prod' },\n  features: { darkMode: true }\n})\n```\n\nOr from JSON:\n\n```ts\nconst config = Config.fromJson('{ \"enabled\": true }')\n```\n\n## Core API\n\n### Access values\n\n```ts\nconfig.get('app.name') // 'MyApp'\nconfig.get('missing.key') // undefined\nconfig.get('missing.key', 'default') // 'default'\n```\n\nProxy fallback also works:\n\n```ts\nconfig['app.env'] // 'prod'\n```\n\n### Check existence\n\n```ts\nconfig.has('features.darkMode') // true\n```\n\n### First match\n\n```ts\nconfig.firstMatch(['missing', 'features.darkMode']) // true\nconfig.firstMatch(['none'], 'fallback') // 'fallback'\n```\n\n### Retrieve many keys\n\n```ts\nconfig.getMany(['app.name', 'features.darkMode'])\n// { 'app.name': 'MyApp', 'features.darkMode': true }\n\nconfig.getMany({ 'unknown': 'default' })\n// { unknown: 'default' }\n```\n\n### Set values\n\n```ts\nconfig.set('app.name', 'NewApp')\nconfig.set({ 'app.env': 'dev', 'features.debug': true })\n```\n\n### Merge with `add()`\n\n```ts\nconfig.add('features', { beta: false })\n// merges into existing `features` object\n\nconfig.add('list', [1])\nconfig.add('list', 2)\n// appends to array if already exists\n```\n\n### Set only if not exists\n\n```ts\nconfig.setIf('features.darkMode', false) // won't overwrite\nconfig.setIf('newKey', 123) // will set\n```\n\n### Check exact value\n\n```ts\nconfig.is('app.env', 'prod') // true or false\n```\n\n### Replace or reset all\n\n```ts\nconfig.setItems({ reset: true })\nconfig.clear() // clears everything\n```\n\n### Export\n\n```ts\nconfig.all() // returns raw object\nconfig.toJson() // returns stringified version\n```\n\n## Full Example\n\n```ts\nconst config = Config.create({ count: 1, nested: { flag: true } })\n\nconfig.set('nested.flag', false)\nconfig.add('nested', { added: 42 })\nconfig.setIf('newKey', 'set only once')\n\nconsole.log(config.get('nested.flag')) // false\nconsole.log(config.get('nested.added')) // 42\nconsole.log(config.get('newKey')) // 'set only once'\n\nconsole.log(config.toJson()) // '{\"count\":1,\"nested\":{\"flag\":false,\"added\":42},\"newKey\":\"set only once\"}'\n```\n\n## Why use `@stone-js/config`?\n\n* Fully tested (100% test coverage)\n* Deep access, merging, and proxy support\n* Can replace many ad-hoc config patterns\n* Clean design with extensibility in mind\n* TypeScript-first\n\n## Summary\n\n`@stone-js/config` is a powerful, type-safe configuration library that simplifies managing application settings. With its fluent API, deep property access, and dynamic proxy fallback, it provides a robust solution for any JavaScript or TypeScript project.\n\n## Learn More\n\nThis package is part of the Stone.js ecosystem, a modern JavaScript framework built around the Continuum Architecture.\n\nExplore the full documentation: [https://stonejs.dev](https://stonejs.dev)\n\n## API documentation\n\n* [API](https://github.com/stone-foundation/stone-js-config/blob/main/docs)\n\n## Contributing\n\nSee [CONTRIBUTING.md](https://github.com/stone-foundation/stone-js-config/blob/main/CONTRIBUTING.md)\n\n## Credits\n\n* [Lodash](https://github.com/lodash/lodash) for deep utilities\n* Inspired by [Laravel Config](https://github.com/laravel/framework/blob/10.x/src/Illuminate/Config/Repository.php)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstone-foundation%2Fstone-js-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstone-foundation%2Fstone-js-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstone-foundation%2Fstone-js-config/lists"}