{"id":20760365,"url":"https://github.com/vanng822/config","last_synced_at":"2025-08-02T15:34:04.830Z","repository":{"id":4972688,"uuid":"6130494","full_name":"vanng822/config","owner":"vanng822","description":"Config class for json configuration files. Support simple structure of ini configuration.","archived":false,"fork":false,"pushed_at":"2013-09-15T11:41:53.000Z","size":144,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-04T12:36:58.043Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"GoCoin/gocoin-ruby","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vanng822.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-10-08T20:09:22.000Z","updated_at":"2019-05-07T19:25:12.000Z","dependencies_parsed_at":"2022-09-26T16:22:15.015Z","dependency_job_id":null,"html_url":"https://github.com/vanng822/config","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/vanng822/config","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanng822%2Fconfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanng822%2Fconfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanng822%2Fconfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanng822%2Fconfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vanng822","download_url":"https://codeload.github.com/vanng822/config/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vanng822%2Fconfig/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259813014,"owners_count":22915199,"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":[],"created_at":"2024-11-17T10:13:20.349Z","updated_at":"2025-06-14T12:06:39.803Z","avatar_url":"https://github.com/vanng822.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## config\nLoad and merge configuration files in js (need to export using module.exports). Can read simple ini format file and convert it to object.\n\n[![build status](https://secure.travis-ci.org/vanng822/config.png)](http://travis-ci.org/vanng822/config)\n\n\n## Usage example\n\tvar Config = require('vnfconfig').Config;\n\tvar c = new Config(['all.js', 'production.js'], __dirname + '/config');\n\tconsole.log(c.host); // output 127.0.0.1\n\tconsole.log(c.port); // output 8000\n\nall.js\n\t\n\tmodule.exports = {\n\t\t'host' : '127.0.0.1',\n\t\t'port' : 3000\n\t};\n\t\nproduction.js\n\t\n\tmodule.exports = {\n\t\t'port': 8000\n\t};\n\n## Classes\n### Config(files, path)\n* `files` array of configuration filenames\n* `path` path to files given above\n \n\n## Functions\n### overrideObject(obj, source1, source2, ...)\nOverride `obj` with properties in source1, source2 and so on\n\n### overrideProperty(obj, prop, value)\nOverride a property in `obj`. Adding property if it does not exist\n\n* `obj` object to override\n* `prop` name of property to override\n* `value` value of the property\n\n### ini2json(filename, callback)\n\n* `filename`\n* `callback(Error, Config)` passing Config if success \n\n### ini2jsonSync(filename)\nSync version of ini2json\n\n* `filename`\n* `Return` Config\n\n### json2ini(obj)\nCreate a string in ini-format of the given obj\n\n* `obj` object to create ini-formatted string\n* `Return` ini-formatted string\n\n### scandir(path)\nScan entire directory for configuration files with extension .js\nThose files need to export an object of configurations\n\n* `path` path of the directory to scan for configurations\n* `Return` Config\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanng822%2Fconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvanng822%2Fconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanng822%2Fconfig/lists"}