{"id":16201649,"url":"https://github.com/bin-huang/node-getenv","last_synced_at":"2026-01-03T19:36:22.488Z","repository":{"id":35044634,"uuid":"200047174","full_name":"Bin-Huang/node-getenv","owner":"Bin-Huang","description":"Get and parse environment variables more easily.","archived":false,"fork":false,"pushed_at":"2023-01-04T05:59:47.000Z","size":212,"stargazers_count":3,"open_issues_count":7,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-12T06:10:59.654Z","etag":null,"topics":["env","environment-variables","getenv","nodejs"],"latest_commit_sha":null,"homepage":"","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/Bin-Huang.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-08-01T12:33:00.000Z","updated_at":"2024-12-30T02:12:15.000Z","dependencies_parsed_at":"2023-01-15T12:39:59.405Z","dependency_job_id":null,"html_url":"https://github.com/Bin-Huang/node-getenv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bin-Huang%2Fnode-getenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bin-Huang%2Fnode-getenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bin-Huang%2Fnode-getenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bin-Huang%2Fnode-getenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bin-Huang","download_url":"https://codeload.github.com/Bin-Huang/node-getenv/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238734076,"owners_count":19521557,"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","environment-variables","getenv","nodejs"],"created_at":"2024-10-10T09:39:23.242Z","updated_at":"2025-10-28T22:31:06.848Z","avatar_url":"https://github.com/Bin-Huang.png","language":"TypeScript","readme":"Get and parse environment variables more easily.\n\n```\nnpm i node-getenv --save\n```\n\n```javascript\nconst env = require('node-getenv')\n\n// PORT=8080 node index.js\nconst port = env.getNum('PORT')  // 8080 (number)\n\n\n// CONSUMER_ON=on node index.js\nenv.getBool('CONSUMER_ON')  // true\n\n// node index.js\nenv.getNum('CONCURRENCY', 4)  // 4 (default value)\n\n// node index.js\nenv.requireNum('CONCURRENCY')   // throw error\nenv.requireNumOrExit('CONCURRENCY')   // log error, then process exit\n```\n\n**getNum(key, defaults)**\n\nGet environment variate in number type.\n\nIf the environment variate is undefined or not a valid number, return the default value.\n\n**getStr(key, defaults)**\n\nGet environment variate in string type.\n\nIf the environment variate is undefined, return the default value.\n\n**getBool(key, defaults)**\n\nGet environment variate in boolean type, supported values **without case sensitive**:\n\n- Truly: `true`, `yes`, `on`, `open`, `t`, `y`, `1`.\n\n- Falsely: `false`, `no`, `off`, `close`, `f`, `n`, `0`.\n\nIf the environment variate is undefined or unsupported, return the default value.\n\n**bindEnv(defaultValues)**\n\nBind environment variates with default values, then returns them. It has no effect on real environmental variables (in `process.env`).\n\n---------------------------------------\n\n**License**: MIT","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbin-huang%2Fnode-getenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbin-huang%2Fnode-getenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbin-huang%2Fnode-getenv/lists"}