{"id":21424131,"url":"https://github.com/linhntaim/dotenv-packed","last_synced_at":"2026-04-19T14:03:13.980Z","repository":{"id":36560133,"uuid":"228548427","full_name":"linhntaim/dotenv-packed","owner":"linhntaim","description":"All-in-one pack to load environment variables from .env file, then expand and convert them. Powered by dotenv/dotenv-flow, dotenv-expand and dotenv-conversion.","archived":false,"fork":false,"pushed_at":"2023-11-06T04:31:23.000Z","size":403,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-23T13:34:24.617Z","etag":null,"topics":["convert","dotenv","dotenv-conversion","dotenv-expand","dotenv-flow","dotenv-packed","env","enviroment-variables","expand","load","node","node-js","node-package","nodejs","npm","parse"],"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/linhntaim.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":"2019-12-17T06:28:19.000Z","updated_at":"2023-10-10T10:53:10.000Z","dependencies_parsed_at":"2025-03-16T20:42:22.255Z","dependency_job_id":"bb9545a5-0dd2-405a-aa98-d298363d3d09","html_url":"https://github.com/linhntaim/dotenv-packed","commit_stats":{"total_commits":12,"total_committers":3,"mean_commits":4.0,"dds":0.5833333333333333,"last_synced_commit":"163c647cd9d1534047ece75650fa55f1da6ea23a"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/linhntaim/dotenv-packed","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linhntaim%2Fdotenv-packed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linhntaim%2Fdotenv-packed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linhntaim%2Fdotenv-packed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linhntaim%2Fdotenv-packed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linhntaim","download_url":"https://codeload.github.com/linhntaim/dotenv-packed/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linhntaim%2Fdotenv-packed/sbom","scorecard":{"id":590830,"data":{"date":"2025-08-11","repo":{"name":"github.com/linhntaim/dotenv-packed","commit":"977386ed88c62978b3a31bba38ef52e83d8c95bf"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":4,"reason":"dependency not pinned by hash detected -- score normalized to 4","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/linhntaim/dotenv-packed/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/linhntaim/dotenv-packed/build.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/linhntaim/dotenv-packed/build.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   1 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":3,"reason":"7 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T21:50:54.655Z","repository_id":36560133,"created_at":"2025-08-20T21:50:54.655Z","updated_at":"2025-08-20T21:50:54.655Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32009239,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"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":["convert","dotenv","dotenv-conversion","dotenv-expand","dotenv-flow","dotenv-packed","env","enviroment-variables","expand","load","node","node-js","node-package","nodejs","npm","parse"],"created_at":"2024-11-22T21:19:48.768Z","updated_at":"2026-04-19T14:03:13.962Z","avatar_url":"https://github.com/linhntaim.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dotenv-packed\n\n[![NPM version](https://img.shields.io/npm/v/dotenv-packed.svg?style=flat-square)](https://www.npmjs.com/package/dotenv-packed)\n[![Github Actions](https://img.shields.io/github/actions/workflow/status/linhntaim/dotenv-packed/build.yml?style=flat-square)](https://github.com/linhntaim/dotenv-packed/actions/workflows/build.yml)\n[![Coveralls](https://img.shields.io/coveralls/github/linhntaim/dotenv-packed?style=flat-square)](https://coveralls.io/github/linhntaim/dotenv-packed)\n[![License](https://img.shields.io/npm/l/dotenv-packed?style=flat-square)](https://github.com/linhntaim/dotenv-packed/blob/master/LICENSE)\n\nAll-in-one pack to load environment variables from `.env` file, then expand and convert them.\nPowered by\n[`dotenv`](https://www.npmjs.com/package/dotenv)/[`dotenv-flow`](https://www.npmjs.com/package/dotenv-flow),\n[`dotenv-expand`](https://www.npmjs.com/package/dotenv-expand)\nand [`dotenv-conversion`](https://www.npmjs.com/package/dotenv-conversion).\n\n---\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [Preload](#preload)\n- [Features](#features)\n- [Documentation](#documentation)\n    - [`pack`](#pack)\n        - [Options](#options)\n        - [Return Value](#return-value)\n\n---\n\n## Installation\n\n```bash\nnpm install dotenv-packed --save\n```\n\n## Usage\n\n- Standalone:\n\n```javascript\n// process.env\nprocess.env.DEBUG = false\n```\n\n```javascript\nconst dotenvPacked = require('dotenv-packed')\n/* or ES6 */\n// import dotenvPacked from 'dotenv-packed'\n\nconst options = {\n    parsed: { // define your variables\n        VARIABLE_1: 'value 1',\n        VARIABLE_2: '1e2',\n        VARIABLE_3: 'boolean:$VARIABLE_2',\n    },\n}\nconst {parsed, get} = dotenvPacked.pack(options)\n\nconsole.log(parsed) // (object) {VARIABLE_1: 'value_1', VARIABLE_2: 100, VARIABLE_3: true}  \nconsole.log(process.env) // (object) { ... , DEBUG: 'false', VARIABLE_1: 'value 1', VARIABLE_2: '100', VARIABLE_3: 'true', ... }\n\nconsole.log(parsed.DEBUG)               // (undefined) 'undefined'\nconsole.log(parsed.VARIABLE_1)          // (string) 'value 1'\nconsole.log(parsed.VARIABLE_2)          // (number) 100\nconsole.log(parsed.VARIABLE_3)          // (boolean) true\n\nconsole.log(get('DEBUG'))               // (string) 'false'\nconsole.log(get('VARIABLE_1'))          // (string) 'value 1'\nconsole.log(get('VARIABLE_2'))          // (number) 100\nconsole.log(get('VARIABLE_3'))          // (boolean) true\n\nconsole.log(process.env.DEBUG)          // (string) 'false'\nconsole.log(process.env.VARIABLE_1)     // (string) 'value 1'\nconsole.log(process.env.VARIABLE_2)     // (string) '100'\nconsole.log(process.env.VARIABLE_3)     // (string) 'true'\n```\n\n- Use `dotenv` to load environment variables from `.env` file:\n\n```dotenv\n# .env file\nVARIABLE_1=\"value 1\"\nVARIABLE_2=1\nVARIABLE_3=boolean:$VARIABLE_2\n```\n\n```javascript\n// process.env\nprocess.env.DEBUG = false\n```\n\n```javascript\nconst dotenvPacked = require('dotenv-packed')\n/* or ES6 */\n// import dotenvPacked from 'dotenv-packed'\n\nconst options = {\n    dotenvOptions: {\n        // Options for `dotenv`.\n        // See https://www.npmjs.com/package/dotenv#options.\n    },\n}\nconst {parsed, get} = dotenvPacked.pack(options)\n\nconsole.log(parsed) // (object) {VARIABLE_1: 'value_1', VARIABLE_2: 100, VARIABLE_3: true}  \nconsole.log(process.env) // (object) { ... , DEBUG: 'false', VARIABLE_1: 'value 1', VARIABLE_2: '100', VARIABLE_3: 'true', ... }\n\nconsole.log(parsed.DEBUG)               // (undefined) 'undefined'\nconsole.log(parsed.VARIABLE_1)          // (string) 'value 1'\nconsole.log(parsed.VARIABLE_2)          // (number) 100\nconsole.log(parsed.VARIABLE_3)          // (boolean) true\n\nconsole.log(get('DEBUG'))               // (string) 'false'\nconsole.log(get('VARIABLE_1'))          // (string) 'value 1'\nconsole.log(get('VARIABLE_2'))          // (number) 100\nconsole.log(get('VARIABLE_3'))          // (boolean) true\n\nconsole.log(process.env.DEBUG)          // (string) 'false'\nconsole.log(process.env.VARIABLE_1)     // (string) 'value 1'\nconsole.log(process.env.VARIABLE_2)     // (string) '100'\nconsole.log(process.env.VARIABLE_3)     // (string) 'true'\n```\n\n- Use `dotenv-flow` to load environment variables from `NODE_ENV`-specific `.env` file:\n\n```dotenv\n# .env.test file\nVARIABLE_1=\"value 1\"\nVARIABLE_2=1\nVARIABLE_3=boolean:$VARIABLE_2\n```\n\n```javascript\n// process.env\nprocess.env.DEBUG = false\n```\n\n```javascript\nconst dotenvPacked = require('dotenv-packed')\n/* or ES6 */\n// import dotenvPacked from 'dotenv-packed'\n\n// load variables from .env.test file\nprocess.env.NODE_ENV = 'test'\n\nconst options = {\n    useFlow: true,\n    dotenvOptions: {\n        // Options for `dotenv-flow`.\n        // See https://www.npmjs.com/package/dotenv-flow#configoptions--object.\n\n        // load variables from .env.test file\n        // (not use environment variable `NODE_ENV`)\n        // node_env: 'test'\n    },\n}\nconst {parsed, get} = dotenvPacked.pack(options)\n\nconsole.log(parsed) // (object) {VARIABLE_1: 'value_1', VARIABLE_2: 100, VARIABLE_3: true}  \nconsole.log(process.env) // (object) { ... , DEBUG: 'false', VARIABLE_1: 'value 1', VARIABLE_2: '100', VARIABLE_3: 'true', ... }\n\nconsole.log(parsed.DEBUG)               // (undefined) 'undefined'\nconsole.log(parsed.VARIABLE_1)          // (string) 'value 1'\nconsole.log(parsed.VARIABLE_2)          // (number) 100\nconsole.log(parsed.VARIABLE_3)          // (boolean) true\n\nconsole.log(get('DEBUG'))               // (string) 'false'\nconsole.log(get('VARIABLE_1'))          // (string) 'value 1'\nconsole.log(get('VARIABLE_2'))          // (number) 100\nconsole.log(get('VARIABLE_3'))          // (boolean) true\n\nconsole.log(process.env.DEBUG)          // (string) 'false'\nconsole.log(process.env.VARIABLE_1)     // (string) 'value 1'\nconsole.log(process.env.VARIABLE_2)     // (string) '100'\nconsole.log(process.env.VARIABLE_3)     // (string) 'true'\n```\n\n## Preload\n\nYou can use the `--require` (`-r`) [command line option](https://nodejs.org/api/cli.html#cli_r_require_module)\nto preload `dotenv-packed`. By doing this, you do not need to require and load\n`dotenv-packed` in your application code.\nThis is the preferred approach when using `import` instead of `require`.\n\n```bash\n$ node -r dotenv-packed/config your_script.js\n```\n\nBy default, `dotenv` is used to load `.env` file.\n\n***Note:* See `dotenv`'s [Preload](https://www.npmjs.com/package/dotenv#preload)\nfor supported command line arguments while using `dotenv` as the loader.\n\nAdditionally, you can have `dotenv-flow` load `NODE_ENV`-specific `.env` file\nby using the command line argument `--use-flow`\nor setting the environment variable `DOTENV_PACKED_USE_FLOW`:\n\n```bash\n$ NODE_ENV=\u003cvalue\u003e node -r dotenv-packed/config your_script.js --use-flow\n# or:\n$ NODE_ENV=\u003cvalue\u003e DOTENV_PACKED_USE_FLOW=true node -r dotenv-packed/config your_script.js\n```\n\nOr you can use the command line argument `--node-env`\ninstead of the environment variable `NODE_ENV` as follows:\n\n```bash\n$ node -r dotenv-packed/config your_script.js --use-flow --node-env \u003cvalue\u003e\n# or:\n$ node -r dotenv-packed/config your_script.js --use-flow --node-env=\u003cvalue\u003e\n```\n\n## Features\n\n- [`dotenv`](https://www.npmjs.com/package/dotenv)\n- [`dotenv-flow`](https://www.npmjs.com/package/dotenv-flow)\n- [`dotenv-expand`](https://www.npmjs.com/package/dotenv-expand)\n- [`dotenv-conversion`](https://www.npmjs.com/package/dotenv-conversion)\n\n## Documentation\n\n`dotenv-packed` exposes only 1 function:\n\n- `pack`\n\n### `pack`\n\n`pack` function will load environment variables from `.env` file and assign them to `process.env`,\nthen expand and convert them.\n\n```javascript\nconst dotenvPacked = require('dotenv-packed')\n/* or ES6 */\n// import dotenvPacked from 'dotenv-packed'\n\nconst options = {\n    // ...\n}\nconst env = dotenvPacked.pack(options)\n```\n\n#### Options\n\n##### `parsed`\n\n*Type:* `object`.\n\nIf this option is set, `dotenv-packed` will use its value\nas the source of environment variables instead of loading from `.env` file.\n\nIf this option is set, `useFlow` option and `dotenvOptions` option will be ignored.\n\n##### `useFlow`\n\n*Type:* `boolean`. *Default:* `false`.\n\nIf this option is set to `false`, `dotenv` will be the loader for `.env` file.\nOtherwise, `dotenv-flow` will.\n\n##### `dotenvOptions`\n\n*Type:* `object`. *Default:* `{}`.\n\nIf `useFlow` is `false`, this option will contain `dotenv`'s [options](https://www.npmjs.com/package/dotenv#options).\nOtherwise, it will contain `dotenv-flow`'s [options](https://www.npmjs.com/package/dotenv-flow#configoptions--object).\n\n##### `dotenvExpandOptions`\n\n*Type:* `object`. *Default:* `{}`.\n\nThis option contains `dotenv-expand`'s [options](https://www.npmjs.com/package/dotenv-expand#options).\n\n##### `dotenvConversionOptions`\n\n*Type:* `object`. *Default:* `{}`.\n\nThis option contains `dotenv-conversion`'s [options](https://www.npmjs.com/package/dotenv-conversion#options).\n\n##### `ignoreProcessEnv`\n\n*Type:* `boolean`.\n\nIf this option is set to `false`, the environment variables' values\nafter expanding and converting will be written back to `process.env`.\nIf this option is set to `true`, they won't.\n\n***Note:* This option will override the option (with the same name and same function)\nin both `dotenv-expand`'s options and `dotenv-conversion`'s options.\nDon't set value for this option when you prefer to\nuse the option in `dotenv-expand`'s options or `dotenv-conversion`'s options.\n\n#### Return Value\n\nThe return value of the `pack` function has two properties: `parsed` and `get`.\n\n##### Property `parsed`\n\n`parsed` is an object of environment variables which have been parsed\n(loaded, then expanded and converted) from `.env` file.\n\n```dotenv\n# .env file\nVARIABLE_1=\"value 1\"\nVARIABLE_2=null\n```\n\n```javascript\n// process.env\nprocess.env.DEBUG = 'true'\n```\n\n```javascript\nconst env = dotenvPacked.pack()\n\n// Only from .env file\nconsole.log(env.parsed) // (object) {VARIABLE_1: 'value 1', VARIABLE_2: null}\n// Include variables parsed from .env file\nconsole.log(process.env) // (object) {..., DEBUG: 'true', VARIABLE_1: 'value 1', VARIABLE_2: 'null', ...}\n```\n\n##### Property `get`\n\n`get` is a helper function to get values of environment variables\nwhich have been parsed from `.env` file or in `process.env`.\n\nThe variables from `.env` file has a higher priority than ones in `process.env`:\n\n```javascript\n// if\nconsole.log(process.env.ONLY_PROCESS_ENV) // (string) 'only process.env'\nconsole.log(process.env.BOTH) // (string) 'from process.env'\n// and\nconsole.log(env.parsed.ONLY_PARSED) // (string) 'only parsed'\nconsole.log(env.parsed.BOTH) // (string) 'from parsed'\n\n// then\nconsole.log(env.get('ONLY_PROCESS_ENV')) // (string) 'only process.env'\nconsole.log(env.get('ONLY_PARSED')) // (string) 'only parsed'\nconsole.log(env.get('BOTH')) // (string) 'from parsed'\n```\n\nUsages:\n\n- Get value of a variable:\n\n```javascript\nconst env = dotenvPacked.pack()\n\n// From .env file\nconsole.log(env.get('VARIABLE_1'))  // (string) 'value 1'\nconsole.log(env.get('VARIABLE_2'))  // (object) null\n// From process.env\nconsole.log(env.get('DEBUG'))       // (string) 'true'\n// Non-existent variable\nconsole.log(env.get('VARIABLE_3'))  // (object) null\n```\n\n***Note:* If the variable is non-existent, the null value will be returned.\n\n- Get value of a variable with its default value\n  which is used as the value for the non-existent variable\n\n```javascript\nconst env = dotenvPacked.pack()\n\n// Existent variables\nconsole.log(env.get('VARIABLE_1', 'default 1'))  // (string) 'value 1'\nconsole.log(env.get('VARIABLE_2', 'default 2'))  // (object) null\n// Non-existent variable\nconsole.log(env.get('VARIABLE_3', 'default 3')) // (string) 'default 3'\n```\n\n- Get values of a set of variables:\n\n```javascript\nconst env = dotenvPacked.pack()\n\nconsole.log(env.get(['VARIABLE_1', 'VARIABLE_2', 'VARIABLE_3'])) // (object) {VARIABLE_1: 'value 1', VARIABLE_2: null, VARIABLE_3: null}\n```\n\n***Note:* If any of variables is non-existent, the null value will be represented as its value.\n\n- Get values of a set of variables with their default values\n  which are used as the values for non-existent variables:\n\n```javascript\nconst env = dotenvPacked.pack()\n\n// This:\nconsole.log(\n    env.get(\n        // set of variables\n        ['VARIABLE_1', 'VARIABLE_2', 'VARIABLE_3'],\n        // default values\n        {VARIABLE_3: 'default 3'}\n    )\n) // (object) {VARIABLE_1: 'value 1', VARIABLE_2: null, VARIABLE_3: 'default 3'}\n\n// Or this:\nconsole.log(\n    env.get({\n        // set of variables + default values\n        VARIABLE_1: 'default 1',\n        VARIABLE_2: 'default 2',\n        VARIABLE_3: 'default 3',\n    })\n) // (object) {VARIABLE_1: 'value 1', VARIABLE_2: null, VARIABLE_3: 'default 3'}\n```\n\n- Get all variables (parsed from `.env` file, have the higher priority, and in `process.env`):\n\n```javascript\nconst env = dotenvPacked.pack()\n\n// This:\nconsole.log(\n    env.get()\n) // (object) {..., DEBUG: 'true', VARIABLE_1: 'value 1', VARIABLE_2: null, ...}\n```\n\n- Get all variables with their default values\n  which are used as the values for non-existent variables:\n\n```javascript\nconst env = dotenvPacked.pack()\n\n// This:\nconsole.log(\n    env.get(null, {VARIABLE_3: 'default 3'})\n) // (object) {..., DEBUG: 'true', VARIABLE_1: 'value 1', VARIABLE_2: null, VARIABLE_3: 'default 3', ...}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinhntaim%2Fdotenv-packed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinhntaim%2Fdotenv-packed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinhntaim%2Fdotenv-packed/lists"}