{"id":15114366,"url":"https://github.com/gtn1024/cjdotenv","last_synced_at":"2025-09-27T18:31:04.249Z","repository":{"id":257625298,"uuid":"858588165","full_name":"gtn1024/cjdotenv","owner":"gtn1024","description":"A Cangjie library to load environment variables from `.env`.","archived":false,"fork":false,"pushed_at":"2025-01-10T14:12:14.000Z","size":69,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-10T15:23:43.639Z","etag":null,"topics":["cangjie","dotenv","environment-variables"],"latest_commit_sha":null,"homepage":"","language":null,"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/gtn1024.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-17T07:08:45.000Z","updated_at":"2025-01-10T14:07:02.000Z","dependencies_parsed_at":"2025-01-10T15:23:43.459Z","dependency_job_id":null,"html_url":"https://github.com/gtn1024/cjdotenv","commit_stats":null,"previous_names":["gtn1024/cjdotenv"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtn1024%2Fcjdotenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtn1024%2Fcjdotenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtn1024%2Fcjdotenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtn1024%2Fcjdotenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gtn1024","download_url":"https://codeload.github.com/gtn1024/cjdotenv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234450857,"owners_count":18834589,"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":["cangjie","dotenv","environment-variables"],"created_at":"2024-09-26T01:42:17.364Z","updated_at":"2025-09-27T18:31:04.244Z","avatar_url":"https://github.com/gtn1024.png","language":null,"funding_links":[],"categories":["Projects"],"sub_categories":["Miscellaneous"],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003eCjDotEnv\u003c/h1\u003e\n  \u003cp\u003eA Cangjie library to load environment variables from \u003ccode\u003e.env\u003c/code\u003e.\u003c/p\u003e\n\u003c/div\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"\" src=\"https://img.shields.io/badge/release-v0.4.0-brightgreen\" style=\"display: inline-block;\" /\u003e\n  \u003cimg alt=\"\" src=\"https://img.shields.io/badge/cjc-v1.0.0-brightgreen\" style=\"display: inline-block;\" /\u003e\n  \u003cimg alt=\"\" src=\"https://github.com/gtn1024/cjdotenv/actions/workflows/ci.yml/badge.svg\" style=\"display: inline-block;\" /\u003e\n\u003c/p\u003e\n\n## 介绍 / Introduction\n\nCjDotEnv is a Cangjie library to load environment variables from `.env` file.\n\nCjDotEnv 是一个用来从 `.env` 文件中加载环境变量的仓颉库。\n\n## 安装 / Installation\n\n```toml\n# In the `dependencies` section of `cjpm.toml`\ncjdotenv = { git = \"https://github.com/gtn1024/cjdotenv.git\", tag = \"0.4.0\" }\n```\n\n## 使用 / Usage\n\n```shell\n# .env\n\n# Database\nDB_HOST=localhost\nDB_USER=postgres\nDB_PASS=123456\nDB_DATABASE=postgres\n```\n\n```cj\nimport cjdotenv.load\nimport std.os.getEnv\n\nmain() {\n    load()\n    // or\n    // load(\".env\")\n    // load(\"path/to/.env\")\n    // load(\"one.env\", \"two.env\", \"three.env\")\n\n    println(getEnv(\"DB_HOST\"))\n    println(getEnv(\"DB_USER\"))\n    println(getEnv(\"DB_PASS\"))\n    println(getEnv(\"DB_DATABASE\"))\n}\n```\n\n## QQ 群\n\n欢迎加入 [仓颉交流群（非官方）：985038695](https://qm.qq.com/q/PcRbAUJSo0)\n\n![qqgroup](./.github/qqgroup.jpg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgtn1024%2Fcjdotenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgtn1024%2Fcjdotenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgtn1024%2Fcjdotenv/lists"}