{"id":14070387,"url":"https://github.com/luqmanoop/parse-dotenv","last_synced_at":"2025-04-14T09:41:02.300Z","repository":{"id":34500047,"uuid":"179766623","full_name":"luqmanoop/parse-dotenv","owner":"luqmanoop","description":"Zero dependency .env to javascript object parser","archived":false,"fork":false,"pushed_at":"2023-01-03T19:17:00.000Z","size":1997,"stargazers_count":8,"open_issues_count":16,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-06T22:32:59.033Z","etag":null,"topics":["env","env-object","nodejs","parse-env","parser"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/parse-dotenv","language":"TypeScript","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/luqmanoop.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":"2019-04-05T23:17:32.000Z","updated_at":"2023-11-30T05:28:53.000Z","dependencies_parsed_at":"2023-01-15T07:30:23.504Z","dependency_job_id":null,"html_url":"https://github.com/luqmanoop/parse-dotenv","commit_stats":null,"previous_names":["luqmanoop/parse-dotenv","codeshifu/parse-dotenv"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luqmanoop%2Fparse-dotenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luqmanoop%2Fparse-dotenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luqmanoop%2Fparse-dotenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luqmanoop%2Fparse-dotenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luqmanoop","download_url":"https://codeload.github.com/luqmanoop/parse-dotenv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248855694,"owners_count":21172627,"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":["env","env-object","nodejs","parse-env","parser"],"created_at":"2024-08-13T07:07:43.044Z","updated_at":"2025-04-14T09:41:02.273Z","avatar_url":"https://github.com/luqmanoop.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# parse-dotenv\n\n\u003e Zero-dependency .env to javascript object parser\n\n![Travis (.org)](https://img.shields.io/travis/codeshifu/parse-dotenv.svg)\n[![Coverage Status](https://coveralls.io/repos/github/codeshifu/parse-dotenv/badge.svg?branch=master)](https://coveralls.io/github/codeshifu/parse-dotenv?branch=master)\n\n## Installation\n\n```bash\nnpm install parse-dotenv --save\n```\n\n## Usage\n\n```bash\n# .env\n\nDB_CONNECTION=mysql\nDB_HOST=127.0.0.1\nDB_PORT=3306\n```\n\n```javascript\nimport parseEnv from \"parse-dotenv\";\n\nconst parsed = parseEnv();\n\nconsole.log(parsed.DB_CONNECTION); // mysql\n```\n\nor provide a path (relative to project root) to env\n\n```javascript\nconst parseEnv = require(\"parse-dotenv\");\n\nconst parsed = parseEnv(\".env.example\");\nconsole.log(parsed.DB_PORT); // 3306\n```\n\n## API\n\n### path\n\nType: `string`\n\nDefault: `path.resolve(process.cwd(), '.env')`\n\n### opts\n\nType: `Object`\n\n#### opts.emptyLines\n\nType: `boolean`\n\nDefault: false\n\nParse empty lines in env file\n\n```javascript\n{\n  emptyLines: true; // parse empty lines in env\n}\n```\n\n#### opts.comments\n\nType: `boolean`\n\nDefault: false\n\nParse empty lines in env file\n\n```javascript\n{\n  comments: true; // parse comments in env\n}\n```\n\n## Related\n\n- [sync-dotenv](https://github.com/codeshifu/sync-dotenv) - Keep your .env in\n  sync with .env.example\n\n## LICENSE\n\nThis project is licensed under [MIT](https://github.com/codeshifu/parse-env/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluqmanoop%2Fparse-dotenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluqmanoop%2Fparse-dotenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluqmanoop%2Fparse-dotenv/lists"}