{"id":19747131,"url":"https://github.com/flickr/flconf","last_synced_at":"2026-05-09T23:44:48.406Z","repository":{"id":45443795,"uuid":"75333189","full_name":"flickr/flconf","owner":"flickr","description":"Simple, pluggable, hierarchical configs","archived":false,"fork":false,"pushed_at":"2021-12-13T19:21:12.000Z","size":66,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-01-10T21:08:06.969Z","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":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flickr.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":"2016-12-01T21:12:04.000Z","updated_at":"2021-12-13T19:21:11.000Z","dependencies_parsed_at":"2022-09-12T23:02:28.837Z","dependency_job_id":null,"html_url":"https://github.com/flickr/flconf","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flickr%2Fflconf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flickr%2Fflconf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flickr%2Fflconf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flickr%2Fflconf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flickr","download_url":"https://codeload.github.com/flickr/flconf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241078464,"owners_count":19905861,"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-12T02:16:54.900Z","updated_at":"2026-05-09T23:44:48.340Z","avatar_url":"https://github.com/flickr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flconf\n\n[![Build Status](https://travis-ci.org/flickr/flconf.svg?branch=master)](https://travis-ci.org/flickr/flconf)\n\n\u003e Simple, pluggable, hierarchical configs\n\n## install\n\n```\n$ npm install flconf --save\n```\n\n## usage\n\nIf you have a config directory that looks like:\n\n```\nconfig\n├── default.json\n└── env\n    ├── development.json\n    ├── production.json\n    └── test.json\n```\n\n``` js\nvar config = require('flconf')(__dirname + '/config');\n\nconfig.use('default');\nconfig.use('env/' + process.env.NODE_ENV || 'development');\n\nmodule.exports = config.load();\n```\n\nflconf will load default.json first, then it will load the config file for the appropriate NODE_ENV. You can specify as many layers of config as you like.\n\nConfig filenames can be globs as matched by [minimatch][1].\n\n## methods\n\n``` js\nvar Config = require('flconf');\n```\n\n### Config(dirname)\n\nCreates a new Config instance. You must provide the dirname that flconf will use while loading config files.\n\nYou can omit the `new` operator and simply invoke flconf with the dirname if you wish:\n\n```\nvar config = require('flconf')(__dirname);\n```\n\n### config.use(file)\n\nAdds `file` as a layer in this config. `file` should be the path to a config file without the `.json` extension.\n\n### config.use(function)\n\nAdds a plugin to this config's plugin stack. Plugins are simply `JSON.parse` reviver functions that modify the config in some way. See the [plugins](#plugins) section for more details.\n\n### config.load()\n\nLoads all of the specified config files and returns the merged config object.\n\n## plugins\n\n### config.env\n\nReplaces any bash-style environment variables with their actual values in the environment.\n\n``` json\n{\n  \"user\": \"${LOGNAME}\"\n}\n```\n\nWill load as:\n\n``` json\n{\n  \"user\": \"ruppel\"\n}\n```\n\n### config.ms\n\n``` js\nconfig.use(config.ms);\n```\n\nReplaces ms-style time strings with their value in milliseconds.\n\n``` json\n{\n  \"maxAge\": \"1 day\"\n}\n```\n\nWill load as:\n\n``` json\n{\n  \"maxAge\": 86400000\n}\n```\n\n## license\n\nThis software is free to use under the MIT license. See the [LICENSE][] file for license text and copyright information.\n\n[1]: https://github.com/isaacs/minimatch\n[LICENSE]: https://github.com/flickr/flconf/blob/master/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflickr%2Fflconf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflickr%2Fflconf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflickr%2Fflconf/lists"}