{"id":13506514,"url":"https://github.com/nuxt-community/dotenv-module","last_synced_at":"2025-05-14T10:12:51.892Z","repository":{"id":39748905,"uuid":"104784134","full_name":"nuxt-community/dotenv-module","owner":"nuxt-community","description":"Loads your .env file into your application context","archived":false,"fork":false,"pushed_at":"2025-03-23T17:15:16.000Z","size":968,"stargazers_count":494,"open_issues_count":10,"forks_count":30,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-01T02:37:41.540Z","etag":null,"topics":["dotenv","nuxt","nuxt-module"],"latest_commit_sha":null,"homepage":null,"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/nuxt-community.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-09-25T18:02:46.000Z","updated_at":"2025-03-29T11:51:33.000Z","dependencies_parsed_at":"2024-01-04T13:38:28.843Z","dependency_job_id":"b907fe35-7fd6-45c9-8f5c-3ffdd0320582","html_url":"https://github.com/nuxt-community/dotenv-module","commit_stats":{"total_commits":67,"total_committers":18,"mean_commits":"3.7222222222222223","dds":0.5522388059701493,"last_synced_commit":"4104085273f22d06e7bcfbba859ef1ae29f34ec8"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxt-community%2Fdotenv-module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxt-community%2Fdotenv-module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxt-community%2Fdotenv-module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuxt-community%2Fdotenv-module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nuxt-community","download_url":"https://codeload.github.com/nuxt-community/dotenv-module/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248339271,"owners_count":21087213,"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":["dotenv","nuxt","nuxt-module"],"created_at":"2024-08-01T01:00:53.028Z","updated_at":"2025-04-11T03:41:11.642Z","avatar_url":"https://github.com/nuxt-community.png","language":"JavaScript","funding_links":[],"categories":["Uncategorized","JavaScript"],"sub_categories":["Uncategorized"],"readme":"# @nuxtjs/dotenv\n\n[![npm version][npm-version-src]][npm-version-href]\n[![npm downloads][npm-downloads-src]][npm-downloads-href]\n[![Circle CI][circle-ci-src]][circle-ci-href]\n[![Codecov][codecov-src]][codecov-href]\n[![License][license-src]][license-href]\n\n\u003e A Nuxt.js module that loads your .env file into your context options\n\n[📖 **Release Notes**](./CHANGELOG.md)\n\n:warning: With Nuxt v2.13 you might want to migrate from @nuxtjs/dotenv module to use the [new runtime config](https://nuxtjs.org/blog/moving-from-nuxtjs-dotenv-to-runtime-config).\n\n## Features\n\nThe module loads variables from your .env file directly into your nuxt.js application `context` and `process.env`.\n\n## Setup\n\n1. Add `@nuxtjs/dotenv` dependency to your project\n\n```bash\nyarn add --dev @nuxtjs/dotenv # or npm install --save-dev @nuxtjs/dotenv\n```\n\n2. Add `@nuxtjs/dotenv` to the `buildModules` section of `nuxt.config.js`\n\n:warning: If you are using a Nuxt version previous than **v2.9** you have to install module as a `dependency` (No `--dev` or `--save-dev` flags) and also use `modules` section in `nuxt.config.js` instead of `buildModules`.\n\n```js\nexport default {\n  buildModules: [\n    // Simple usage\n    '@nuxtjs/dotenv',\n\n    // With options\n    ['@nuxtjs/dotenv', { /* module options */ }]\n  ]\n}\n```\n\n### Using top level options\n\n```js\nexport default {\n  buildModules: [\n    '@nuxtjs/dotenv'\n  ],\n  dotenv: {\n    /* module options */\n  }\n}\n```\n\n## Options\n\n### `only`\n\n- Type: `Array[String]`\n- Default: `null`\n\nIf you want to restrict what's accessible into the context,\nyou can pass to the module options an `only` array with the keys you want to allow.\n\n```js\nexport default {\n  buildModules: [\n    ['@nuxtjs/dotenv', { only: ['some_key'] }]\n  ]\n}\n```\n\n### `path`\n\n- Type: `String`\n- Default: `srcDir`\n\nBy default, the we'll be loading the `.env` file from the root of your project.\nIf you want to change the path of the folder where we can find the `.env` file, then use the `path` option.\n\n```js\nexport default {\n  buildModules: [\n    ['@nuxtjs/dotenv', { path: '/path/to/my/global/env/' }]\n  ]\n}\n```\n\n\u003e **Note:** that this is the path to the *folder* where the `.env` file live, not to the `.env` file itself.\n\nThe path can be absolute or relative.\n\n### systemvars\n\n- Type: `Boolean`\n- Default: `false`\n\nBy default this is false and variables from your system will be ignored.\nSetting this to true will allow your system set variables to work.\n\n```js\nexport default {\n  buildModules: [\n    ['@nuxtjs/dotenv', { systemvars: true }]\n  ]\n}\n```\n\n### filename\n\n- Type: `String`\n- Default: `.env`\n\nWe can override the filename when we need to use different config files for different environments.\n\n```js\nexport default {\n  buildModules: [\n    ['@nuxtjs/dotenv', { filename: '.env.prod' }]\n  ]\n}\n```\n\n## Usage\n\nAfter creating your .env file in the project root, simply run your usual `yarn dev` or `npm run dev`.\nThe variable inside the .env file will be added to the context (`context.env`) and process (`process.env`).\n\n## Using .env file in nuxt.config.js\n\nThis module won't overload the environment variables of the process running your build.\n\nIf you need to use variables from your .env file at this moment,\njust prepend `require('dotenv').config()` to your `nuxt.config.js`:\n\n```js\nrequire('dotenv').config()\n\nexport default {\n  // your usual nuxt config.\n}\n```\n\nThis will works thanks to the `dotenv` library provided by this module as a dependency.\nIf you decided to ignore some values from your `.env` file in the module configuration, this won't apply here.\n\n## License\n\n[MIT License](./LICENSE)\n\nCopyright (c) Nuxt Community\n\n\u003c!-- Badges --\u003e\n[npm-version-src]: https://img.shields.io/npm/v/@nuxtjs/dotenv/latest.svg?style=flat-square\n[npm-version-href]: https://npmjs.com/package/@nuxtjs/dotenv\n\n[npm-downloads-src]: https://img.shields.io/npm/dt/@nuxtjs/dotenv.svg?style=flat-square\n[npm-downloads-href]: https://npmjs.com/package/@nuxtjs/dotenv\n\n[circle-ci-src]: https://img.shields.io/circleci/project/github/nuxt-community/dotenv-module.svg?style=flat-square\n[circle-ci-href]: https://circleci.com/gh/nuxt-community/dotenv-module\n\n[codecov-src]: https://img.shields.io/codecov/c/github/nuxt-community/dotenv-module.svg?style=flat-square\n[codecov-href]: https://codecov.io/gh/nuxt-community/dotenv-module\n\n[license-src]: https://img.shields.io/npm/l/@nuxtjs/dotenv.svg?style=flat-square\n[license-href]: https://npmjs.com/package/@nuxtjs/dotenv\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuxt-community%2Fdotenv-module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnuxt-community%2Fdotenv-module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuxt-community%2Fdotenv-module/lists"}