{"id":22221971,"url":"https://github.com/fabiospampinato/dotenv-jsonc","last_synced_at":"2025-10-14T10:35:40.601Z","repository":{"id":65329883,"uuid":"589723856","full_name":"fabiospampinato/dotenv-jsonc","owner":"fabiospampinato","description":"Simple library for loading your .env.json file containing JSONC.","archived":false,"fork":false,"pushed_at":"2025-01-25T20:36:15.000Z","size":9,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-26T10:36:35.335Z","etag":null,"topics":["dotenv","json","jsonc"],"latest_commit_sha":null,"homepage":"","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/fabiospampinato.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,"zenodo":null},"funding":{"github":"fabiospampinato","custom":"https://www.paypal.me/fabiospampinato"}},"created_at":"2023-01-16T19:36:24.000Z","updated_at":"2025-01-25T20:36:20.000Z","dependencies_parsed_at":"2025-07-27T16:42:23.080Z","dependency_job_id":null,"html_url":"https://github.com/fabiospampinato/dotenv-jsonc","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/fabiospampinato/dotenv-jsonc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fdotenv-jsonc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fdotenv-jsonc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fdotenv-jsonc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fdotenv-jsonc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabiospampinato","download_url":"https://codeload.github.com/fabiospampinato/dotenv-jsonc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fdotenv-jsonc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018778,"owners_count":26086452,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["dotenv","json","jsonc"],"created_at":"2024-12-02T23:16:24.861Z","updated_at":"2025-10-14T10:35:40.581Z","avatar_url":"https://github.com/fabiospampinato.png","language":"JavaScript","funding_links":["https://github.com/sponsors/fabiospampinato","https://www.paypal.me/fabiospampinato"],"categories":[],"sub_categories":[],"readme":"# Dotenv JSONC\n\nSimple library for loading your `.env.json` file containing JSONC.\n\n## Overview\n\n- You are expected to have a `.env.jsonc`, or `.env.json`, or `.env` file containing JSON, with optional comments in it, at the root of your current working directory.\n- If none of those files are found this library will throw.\n- When reading environment variables the file is simply only parsed with [`tiny-jsonc`](https://github.com/fabiospampinato/tiny-jsonc).\n- When extending environment variables values are always casted to strings first.\n\n## Install\n\n```sh\nnpm install dotenv-jsonc\n```\n\n## Usage\n\nExample `.env.json` file:\n\n```jsonc\n{\n  // You can use comments, if you want to\n  \"S3_BUCKET\": \"BUCKET_NAME\",\n  \"S3_BUCKET_PASSWORD\": \"BUCKET_PASSWORD\"\n}\n```\n\nRead the content of your `.env.json` file, without extending environment variables:\n\n```ts\nimport Dotenv from 'dotenv-jsonc';\n\nconsole.log ( Dotenv ); // =\u003e { S3_BUCKET: \"BUCKET_NAME\", S3_BUCKET_PASSWORD: \"BUCKET_PASSWORD\" }\nconsole.log ( process.env.S3_BUCKET ); // =\u003e undefined\nconsole.log ( process.env.S3_BUCKET_PASSWORD ); // =\u003e undefined\n```\n\nRead the content of your `.env.json` file, and extend environment variables:\n\n```ts\nimport Dotenv from 'dotenv-jsonc/register';\n\nconsole.log ( Dotenv ); // =\u003e { S3_BUCKET: \"BUCKET_NAME\", S3_BUCKET_PASSWORD: \"BUCKET_PASSWORD\" }\nconsole.log ( process.env.S3_BUCKET ); // =\u003e \"BUCKET_NAME\"\nconsole.log ( process.env.S3_BUCKET_PASSWORD ); // =\u003e \"BUCKET_PASSWORD\"\n```\n\nJust extend environment variables:\n\n```ts\nimport 'dotenv-jsonc/register';\n\nconsole.log ( process.env.S3_BUCKET ); // =\u003e \"BUCKET_NAME\"\nconsole.log ( process.env.S3_BUCKET_PASSWORD ); // =\u003e \"BUCKET_PASSWORD\"\n```\n\nSimple, right?\n\n## License\n\nMIT © Fabio Spampinato\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiospampinato%2Fdotenv-jsonc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabiospampinato%2Fdotenv-jsonc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiospampinato%2Fdotenv-jsonc/lists"}