{"id":25599279,"url":"https://github.com/byu-oit/dottfvars","last_synced_at":"2026-04-21T22:30:18.170Z","repository":{"id":40284153,"uuid":"351906291","full_name":"byu-oit/dottfvars","owner":"byu-oit","description":"Loads environment variables from a .tfvars file into process.env","archived":false,"fork":false,"pushed_at":"2023-07-19T01:59:14.000Z","size":3817,"stargazers_count":0,"open_issues_count":17,"forks_count":0,"subscribers_count":19,"default_branch":"main","last_synced_at":"2025-02-20T19:48:39.073Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/byu-oit.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-26T20:38:14.000Z","updated_at":"2022-05-16T22:12:39.000Z","dependencies_parsed_at":"2023-02-06T14:01:15.189Z","dependency_job_id":null,"html_url":"https://github.com/byu-oit/dottfvars","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/byu-oit%2Fdottfvars","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byu-oit%2Fdottfvars/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byu-oit%2Fdottfvars/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byu-oit%2Fdottfvars/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/byu-oit","download_url":"https://codeload.github.com/byu-oit/dottfvars/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240027819,"owners_count":19736281,"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":[],"created_at":"2025-02-21T14:21:37.788Z","updated_at":"2026-04-21T22:30:18.135Z","avatar_url":"https://github.com/byu-oit.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dottfvars\n\nParses a `.tfvars` or `.tfvars.json` file and adds the key value pairs\nto the node environment variables (`process.env`). This module is\nintended to be used in conjunction with the\n[`env-var` module](https://www.npmjs.com/package/env-var).\n\n## Install\n\nPublished on **GPR** and **NPM**.\n\n```bash\nnpm i @byu-oit/dottfvars\n```\n\n## Usage\n\n#### from\n\nAdd contents of a tfvars file to process.env. The contents of\nprocess.env will not be overwritten by the contents of your tfvars.\n\n```ts\nimport {resolve} from 'path'\nimport * as dottfvars from '@byu-oit/dottfvars'\nimport env from 'env-var'\n\ndottfvars.from(resolve(__dirname, 'iac/development.tfvars'))\nconst imageId = env.from(process.env).get('image_id').asString()\n```\n\nAlternatively, you may define your tfvars as JSON and pass in a\n`.tfvars.json` file path instead.\n\n#### parse\n\nSometimes you may just want the JSON representation of the tfvars file\nwithout merging it with process.env\n\n```ts\nimport {resolve} from 'path'\nimport * as dottfvars from '@byu-oit/dottfvars'\nimport env from 'env-var'\n\nconst container = dottfvars.parse(resolve(__dirname, 'local.tfvars'))\nconst imageId = env.from(container).get('image_id').asString()\n```\n\nRelated Packages:\n- [env-ssm](https://github.com/byu-oit/env-ssm#readme)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyu-oit%2Fdottfvars","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbyu-oit%2Fdottfvars","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyu-oit%2Fdottfvars/lists"}