{"id":48315837,"url":"https://github.com/iswilljr/config-env-file","last_synced_at":"2026-04-05T00:31:40.668Z","repository":{"id":57205358,"uuid":"464257886","full_name":"iswilljr/config-env-file","owner":"iswilljr","description":"A command line to generate a .env.local based on a Config","archived":false,"fork":false,"pushed_at":"2024-07-18T17:31:16.000Z","size":227,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-27T19:51:34.339Z","etag":null,"topics":["cli","command-line","command-line-tool","config","configuration","dotenv","env","environment-variables","nodejs"],"latest_commit_sha":null,"homepage":"https://xlug.vercel.app/cef","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/iswilljr.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-02-27T21:28:08.000Z","updated_at":"2023-08-12T04:02:00.000Z","dependencies_parsed_at":"2023-12-31T00:13:51.199Z","dependency_job_id":"e6fe9644-e1a3-4088-96ad-d69929b33462","html_url":"https://github.com/iswilljr/config-env-file","commit_stats":{"total_commits":49,"total_committers":2,"mean_commits":24.5,"dds":0.04081632653061229,"last_synced_commit":"ada8684902b15245ece3bf80a49b94256e6bf879"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/iswilljr/config-env-file","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iswilljr%2Fconfig-env-file","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iswilljr%2Fconfig-env-file/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iswilljr%2Fconfig-env-file/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iswilljr%2Fconfig-env-file/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iswilljr","download_url":"https://codeload.github.com/iswilljr/config-env-file/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iswilljr%2Fconfig-env-file/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31420084,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T00:25:07.052Z","status":"ssl_error","status_checked_at":"2026-04-05T00:25:05.923Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cli","command-line","command-line-tool","config","configuration","dotenv","env","environment-variables","nodejs"],"created_at":"2026-04-05T00:31:40.111Z","updated_at":"2026-04-05T00:31:40.650Z","avatar_url":"https://github.com/iswilljr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CONFIG ENV FILE\n\n\u003e A command line to generate a `.env` file based on a Config\n\n## Why?\n\nIf you have a config in a json format and you don't want to expose your config to the public, you can pass it to a `.env` file but make a `.env` file by hand with the json file may take a while. This command will generate a `.env` file for you.\n\n## Install\n\n```bash\n# npm\nnpm install -g config-env-file\n# npx\nnpx config-env-file [config-file] [options]\n# yarn\nyarn global add config-env-file\n```\n\n## Usage\n\n```bash\ncef ./config.json\n# config.json: { \"api\": 1, \"key\": 2 }\n# output:\n#   const config = {\n#     api: process.env.API,\n#     key: process.env.KEY\n#   }\n# .env.local:\n#   API=\"1\"\n#   KEY=\"2\"\n```\n\n### Example with a firebase project\n\nWhen you use firebase in your app, you might not want to expose the firebase config. Pass the config to an `.env` file may take a while doing it by hand. This is a simple example to generate a `.env` file from a firebase config.\n\n```bash\ntouch firebase.config.json\n# copy the firebase config to firebase.config.json\n# firebase.config.json:\n# { \"apiKey\": \"example\", \"authDomain\": \"example.firebaseapp.com\", ... }\n\ncef firebase.config.json\n# .env.local:\n# API_KEY=\"example\"\n# AUTH_DOMAIN=\"example.firebaseapp.com\"\n# ...\n\n# output:\n# const config = {\n#   apiKey: process.env.API_KEY,\n#   authDomain: process.env.AUTH_DOMAIN\n#   ...\n# }\n```\n\n## Options\n\n### Prefix\n\nadd prefix to variables name. default `undefined`\n\n```bash\ncef ./config.json --prefix public\n# config.json: { \"apiUrl\": \"https://...\" }\n# output:\n#   const config = {\n#     apiUrl: process.env.PUBLIC_API_URL,\n#   }\n# .env.local:\n#   PUBLIC_API_URL=\"https://...\"\n```\n\n### Include Objects Values\n\nwhether to include object values or not. default `false`.\n\n```bash\n# config: { \"api\": 6, \"client\": { \"id\": 1, \"secret\": 6 } }\n\ncef ./config.json\n# .env.local:\n#   API=\"6\"\n\ncef ./config.json --include-objects\n# .env.local:\n#   API=\"6\"\n#   CLIENT=\"{\"id\":1,\"secret\":6}\"\n```\n\n### Env\n\nhow to access variables. choices `\"process\"`, `\"import\"`. default `\"process\"`.\n\n```bash\ncef ./config.json --env import\n# output:\n#   const config = {\n#     api: import.meta.env.API,\n#     key: import.meta.env.KEY\n#   }\n```\n\n### Other options\n\n- `destination`: destination path to env file. default `\".\"`.\n- `extension`: extension to env file name. default `\"local\"`.\n- `single-quotes`: use single quotes in env values. default `false`.\n- `no-quotes`: don't add quotes to env values. default `false`.\n- `silent`: skip console logs. default `false`.\n\nRun `cef --help` for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiswilljr%2Fconfig-env-file","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiswilljr%2Fconfig-env-file","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiswilljr%2Fconfig-env-file/lists"}