{"id":23174217,"url":"https://github.com/coursedesign/conev-source-json","last_synced_at":"2026-05-06T17:34:22.914Z","repository":{"id":37826756,"uuid":"248268569","full_name":"CourseDesign/conev-source-json","owner":"CourseDesign","description":"conev-source-json is an implementation of conev's source to get configuration from json.","archived":false,"fork":false,"pushed_at":"2023-01-24T06:02:16.000Z","size":23,"stargazers_count":0,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-10T08:51:29.051Z","etag":null,"topics":["conev","configuration","environment","npm","npm-package"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/conev-source-json","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CourseDesign.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-18T15:23:00.000Z","updated_at":"2021-10-14T06:50:32.000Z","dependencies_parsed_at":"2023-02-13T18:20:23.726Z","dependency_job_id":null,"html_url":"https://github.com/CourseDesign/conev-source-json","commit_stats":null,"previous_names":["kdpark0723/conev-source-json"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CourseDesign%2Fconev-source-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CourseDesign%2Fconev-source-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CourseDesign%2Fconev-source-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CourseDesign%2Fconev-source-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CourseDesign","download_url":"https://codeload.github.com/CourseDesign/conev-source-json/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247268502,"owners_count":20911147,"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":["conev","configuration","environment","npm","npm-package"],"created_at":"2024-12-18T05:19:38.060Z","updated_at":"2026-05-06T17:34:22.885Z","avatar_url":"https://github.com/CourseDesign.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# conev-source-json\n\nconev-source-json is an implementation of conev's source to get configuration from json.\n\n![](https://img.shields.io/npm/dm/conev-source-json.png?style=flat-square)\n\n​    \n\n## Install\n\n```shell\n# with npm \nnpm install conev-source-json\n \n# or with Yarn \nyarn add conev-source-json\n```\n\n​    \n\n## Usage\n\nGet ConfigBuilder from conev and Sources to use.\n\n```typescript\nimport { ConfigBuilder } from 'conev';\nimport JsonSource from 'conev-source-json';\n```\n\nAnd create Source and set up.\n\n```typescript\nconst jsonSource = new JsonSource();\n\njsonSource    \n\t.setConfig('basic', basic) // basic is JSON\n    .setConfig('dev', dev) // dev is JSON\n    .setConfig('prd', prd); // prd is JSON\n```\n\nCreate ConfigBuilder and set Environment, add source. (highest priority is added first).\n\n```typescript\nconst builder = new ConfigBuilder();\n\nbuilder\n    .setEnv('dev', 'basic')\n    .addSource(jsonSource);\n```\n\nBuild configuration\n\n```typescript\nconst config = await builder.build(); // This is the result of combining dev and basic.\n```\n\nUse configuration\n\n```typescript\nconfig.get() // The whole configuration created comes out\nconfig.get('a.b.c'); // Is same as config.get().a.b.c\n```\n\n​    \n\n## Json Source\n\n```typescript\nclass JsonSource {\n    constructor(map?: Map\u003cstring, object\u003e);\n    setConfig(env: string, ...values: object[]): JsonSource\n    addConfig(env: string, ...values: object[]): JsonSource;\n    removeConfig(env: string): JsonSource;\n    export(): Promise\u003cMap\u003cstring, object\u003e\u003e;\n}\n\n```\n\n`JsonSource` defines the source from JSON. Use `setConfig` to add a configuration for a new environment or ` removeConfig` to delete a configuration. Map is returned as the result value of `export`. The key of this map is environment and the value is the configuration when environment.\n\n​    \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoursedesign%2Fconev-source-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoursedesign%2Fconev-source-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoursedesign%2Fconev-source-json/lists"}