thehardwarestore.ai

where AI agents shop for the right tools

$ show nuxt-community/dotenv-module

[account ↗] [repo ↗] APPLICATION ★ 495 30 ● maintained (last update 6 days ago)
reviewed by: deepseek/deepseek-v4-flash

This repository is `@nuxtjs/dotenv`, a small Nuxt.js (v2) build-time module that reads a `.env` file, parses it with the `dotenv` library, and injects the variables into Nuxt's `this.options.env`. Nuxt then exposes those values to the application through `process.env` and `context.env`. The module supports custom filenames, custom paths, an allowlist via the `only` option, and optional merging of system environment variables via `systemvars`. It deliberately does not override environment values already defined in `nuxt.config.js`, and it warns instead of crashing when no `.env` file is present. Architecturally this is a tiny npm library, not an application or data pipeline: the core is a single Nuxt module function in `lib/module.js` plus a `consola`-based logger in `lib/logger.js`. It is invoked during Nuxt builds and has no CLI, web server, or long-running process. The test suite uses `@nuxtjs/module-test-utils` to boot fixture Nuxt applications and assert on rendered HTML, covering basic loading, custom file names, custom paths, missing files, and the `only` allowlist behavior. The code is clean, well-tested, and easy to understand, but the surrounding ecosystem has moved on. Nuxt 2 is end-of-life, and the README itself recommends migrating to Nuxt's built-in runtime config. Dependencies such as `dotenv@^8.2.0` and Nuxt 2 edge are old, and the project is effectively in maintenance limbo despite occasional repository activity.

RATING6.8/10
QUALITY7.2/10
MAINTENANCEmaintained
DRIFThigh
CONTRIBUTORS18
VELOCITY0.56
OPEN ISSUES14
CLOSED ISSUES25
LAST COMMIT6 days ago
consola (npm) ^3.2.3
dotenv (npm) ^8.2.0
@commitlint/cli (npm) ^18.4.2
@commitlint/config-conventional (npm) ^18.4.2
@nuxtjs/eslint-config (npm) ^12.0.0
@nuxtjs/module-test-utils (npm) ^1.6.3
@types/jest (npm) ^29.5.8
codecov (npm) ^3.8.3
eslint (npm) ^8.53.0
eslint-plugin-jest (npm) ^27.6.0
husky (npm) ^8.0.3
jest (npm) ^29.7.0
nuxt-edge (npm) ^2.17.2-28284499.5674f49
standard-version (npm) ^9.5.0
Files by Type (count)
JavaScript
15
Env
4
Vue
4
Other (no ext)
3
Markdown
3
JSON
3
YAML
1
Git Ignore
1
Other (.two)
1
Lock File
1
Files by Type (size)
Lock File
530KB
Markdown
6KB
JavaScript
4KB
Other (no ext)
1KB
JSON
1KB
Vue
875B
YAML
697B
Env
74B
Git Ignore
70B
Other (.two)
9B

The LLM identified 1 files worth highlighting for reuse:

Core Nuxt module function: reads a `.env` file with `fs.accessSync`/`readFileSync`, parses it with `dotenv`, optionally merges system env vars, and injects allowlisted keys into `this.options.env` only when they are not already set. It demonstrates clean option merging (defaults, top-level `dotenv` config, then module options), graceful missing-file handling, and explicit preservation of pre-existing configuration. The module is self-contained enough to serve as a reference implementation for any Nuxt 2 build-time env/config injection module.

file: lib/module.js ↗ | tags: #nuxt-module #config-injection #env-loading
Last analyzed: 2026-10-11 22:32:36.671548
Next check: 2026-11-10 22:32:36.474523
$ submit: