{"id":19055812,"url":"https://github.com/ehcaning/envparser","last_synced_at":"2025-09-03T00:36:37.466Z","repository":{"id":57110858,"uuid":"348031172","full_name":"ehcaning/envparser","owner":"ehcaning","description":"Environment variable parser package for npm","archived":false,"fork":false,"pushed_at":"2021-03-15T16:56:15.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-26T00:42:23.132Z","etag":null,"topics":["env","parser"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@ehcan/envparser","language":"TypeScript","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/ehcaning.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}},"created_at":"2021-03-15T15:49:53.000Z","updated_at":"2021-05-25T13:23:28.000Z","dependencies_parsed_at":"2022-08-21T07:30:59.404Z","dependency_job_id":null,"html_url":"https://github.com/ehcaning/envparser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ehcaning/envparser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehcaning%2Fenvparser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehcaning%2Fenvparser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehcaning%2Fenvparser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehcaning%2Fenvparser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ehcaning","download_url":"https://codeload.github.com/ehcaning/envparser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehcaning%2Fenvparser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261534556,"owners_count":23173423,"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","parser"],"created_at":"2024-11-08T23:47:05.861Z","updated_at":"2025-06-23T18:36:19.944Z","avatar_url":"https://github.com/ehcaning.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Env Parser\n\nA simple module for parse env variables into required type.\n\nExample:\n\n```js\nconst env = require('@ehcan/envparser');\n\nconfig = {\n\tdb: {\n\t\thost: env.str('DB_HOST', 'localhost'),\n\t\tport: env.num('DB_PORT', 5432),\n\t\tusername: env.str('DB_USER', 'user_1'),\n\t\tpassword: env.str('DB_PASS', 'passwd'),\n\t\tqueryLog: env.bool('DB_QUERY_LOG', true),\n\t\toptions: env.array('DB_OPTIONS', ['option_1', 'option_2']),\n\t},\n};\n\nconsole.log(config);\n```\nWithout `env` file:\n```json\nconsole.log(config);\n\n{\n  \"db\": {\n    \"host\": \"localhost\",\n    \"port\": 5432,\n    \"username\": \"user_1\",\n    \"password\": \"passwd\",\n    \"queryLog\": true,\n    \"options\": [\n      \"option_1\",\n      \"option_2\"\n    ]\n  }\n}\n```\n\nWith `env` file:\n```env\nDB_HOST=pg\nDB_PORT=5400\nDB_USER=my_user\nDB_PASS=my_pass\nDB_QUERY_LOG=false\nDB_OPTIONS=option_3,option_4\n```\n\n```json\nconsole.log(config);\n\n{\n  \"db\": {\n    \"host\": \"pg\",\n    \"port\": 5400,\n    \"username\": \"my_user\",\n    \"password\": \"my_pass\",\n    \"queryLog\": false,\n    \"options\": [\n      \"option_3\",\n      \"option_4\"\n    ]\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fehcaning%2Fenvparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fehcaning%2Fenvparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fehcaning%2Fenvparser/lists"}