{"id":18046333,"url":"https://github.com/juri/dotenvy","last_synced_at":"2025-04-10T04:42:15.098Z","repository":{"id":239054467,"uuid":"798371545","full_name":"juri/dotenvy","owner":"juri","description":"DotEnv handling for Swift","archived":false,"fork":false,"pushed_at":"2024-05-18T13:09:35.000Z","size":61,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-07T12:48:06.767Z","etag":null,"topics":["dotenv","dotenv-parser","swift","swift-on-server"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/juri.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-05-09T16:38:09.000Z","updated_at":"2024-06-10T14:04:41.000Z","dependencies_parsed_at":"2024-05-09T18:44:46.580Z","dependency_job_id":"7998e076-1646-40b1-8299-75ef7a41bff6","html_url":"https://github.com/juri/dotenvy","commit_stats":null,"previous_names":["juri/dotenvy"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juri%2Fdotenvy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juri%2Fdotenvy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juri%2Fdotenvy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juri%2Fdotenvy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juri","download_url":"https://codeload.github.com/juri/dotenvy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248161104,"owners_count":21057552,"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":["dotenv","dotenv-parser","swift","swift-on-server"],"created_at":"2024-10-30T19:06:58.290Z","updated_at":"2025-04-10T04:42:15.080Z","avatar_url":"https://github.com/juri.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DotEnvy\n\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fjuri%2Fdotenvy%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/juri/dotenvy)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fjuri%2Fdotenvy%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/juri/dotenvy)\n![Swift build status](https://github.com/juri/dotenvy/actions/workflows/build.yml/badge.svg)\n\nDotEnvy is a dotenv file parser for Swift. It allows you to load values from an `.env` file, similar to the libraries\nfor [node.js], [Python], [Ruby], [Rust][Rust][^1] etc.\n\n[^1]: I accidentally used the same name they use; apologies!\n\nDotEnvy supports multiline strings and variable substitution.\n\n[node.js]: https://github.com/motdotla/dotenv\n[Python]: https://pypi.org/project/python-dotenv/\n[Ruby]: https://github.com/bkeepers/dotenv\n[Rust]: https://docs.rs/dotenvy/latest/dotenvy/\n\n## Documentation\n\nFor more detailed syntax examples and API documentation visit DotEnvy's [documentation] on Swift Package Index.\n\n[documentation]: https://swiftpackageindex.com/juri/dotenvy/documentation/dotenvy\n\n## Supported format\n\nThe dotenv format does not have a specification, but this library supports the common features. The syntax\nresembles Bash. Examples:\n\n```sh\nKEY=value\nKEY2 = \"quoted value\"\n \n KEY3= unquoted value \"with\" quotes inside\n# comment\nKEY4 ='quoted value referring to ${KEY3}' # trailing comment\nKEY5=unquoted value referring to ${KEY4}\nKEY6=\"multiline\nstring\"\n```\n\n## Error reporting\n\nDotEnvy has helpful error reporting on syntax errors.\n\n```swift\nlet source = #\"\"\"\nKEY=\"VALUE\n\"\"\"#\ndo {\n    _ = try DotEnvironment.parse(string: source)\n} catch let error as ParseErrorWithLocation {\n    let formatted = error.formatError(source: source)\n    print(formatted)\n}\n```\n\noutputs\n\n```\n   1: KEY=\"VALUE\n                ^\n\nError on line 1: Unterminated quote\n```\n\n## Command Line\n\nThere's also a command line tool, `dotenv-tool`. It supports checking dotenv files for syntax errors and converting\nthem to JSON. To install, run:\n\n```sh\nswift build -c release\ncp .build/release/dotenv-tool /usr/local/bin\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuri%2Fdotenvy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuri%2Fdotenvy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuri%2Fdotenvy/lists"}