{"library":"node-env-run","title":"Node Environment Run","description":"node-env-run is a command-line utility designed to simplify the process of loading environment variables from `.env` files and executing Node.js scripts or other commands with those variables pre-loaded. It leverages the popular `dotenv` library under the hood for parsing `.env` files. The package is currently at version 4.0.2 and appears to be actively maintained; while an explicit release cadence isn't stated in the provided documentation, updates often follow the underlying `dotenv` library or address bug fixes. Its key differentiators include flexible command execution (e.g., with `nodemon`, `python`), the ability to specify custom `.env` file paths, and options to override existing environment variables, making it a robust tool for local development setups.","language":"javascript","status":"active","last_verified":"Tue Apr 21","install":{"commands":["npm install node-env-run"],"cli":{"name":"node-env-run","version":null}},"imports":["nodenv ./my-script.js","npx node-env-run ./my-script.js","import type { EnvRunOptions } from 'node-env-run';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// package.json\n{\n  \"name\": \"my-app\",\n  \"version\": \"1.0.0\",\n  \"scripts\": {\n    \"start\": \"nodenv .\"\n  }\n}\n\n// .env\nHELLO_MESSAGE=\"Hello from .env!\"\nPORT=3000\n\n// index.js (main script)\nconsole.log(`Loading application on port ${process.env.PORT ?? 'unknown'}.`);\nconsole.log(process.env.HELLO_MESSAGE ?? 'No message loaded.');\n\n// To run:\n// 1. npm install node-env-run --save-dev\n// 2. npm run start","lang":"typescript","description":"This example demonstrates how to set up `node-env-run` in `package.json` to load environment variables from a `.env` file and execute the main script, showing variables being accessed.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}