CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/npm-grunt-env

tessl install tessl/npm-grunt-env@1.0.0

Grunt plugin for specifying environment variable configurations in task chains

Agent Success

Agent success rate when using this tile

81%

Improvement

Agent success rate improvement when using this tile compared to baseline

0.99x

Baseline

Agent success rate without this tile

82%

task.mdevals/scenario-1/

Config File Env Loader

A utility that ingests environment variable definitions from external configuration files and applies them to the running process.

Capabilities

Load multiple formats

  • Given an ordered list of .env-style text and JSON files, it parses each and applies their key/value pairs to the environment so later files override earlier ones (e.g., .env sets PORT=3000, JSON sets "PORT":"9000" and "MODE":"prod", resulting env has PORT=9000 and MODE=prod). @test

Preserve existing values when requested

  • When an option to keep existing variables is enabled, keys already present in the environment are left unchanged even if later config files declare different values (e.g., pre-set API_KEY=from-env remains even if a YAML file sets API_KEY: override). @test

Parse YAML and INI files

  • It can parse YAML and INI configuration files alongside .env and JSON, applying their top-level key/value pairs to the environment in the provided order (e.g., YAML cache: true and INI timeout=45 become string values cache="true" and timeout="45"). @test

Implementation

@generates

API

/**
 * Applies environment variables from the provided config file paths.
 *
 * @param {string[]} files - Ordered list of config files to parse; later entries take precedence.
 * @param {{ override?: boolean }} [options] - When override is false, existing environment values are preserved; defaults to true.
 * @returns {Promise<Record<string, string>>} Resolves with the key/value pairs applied from the files.
 */
async function applyEnvironmentFromFiles(files, options);

Dependencies { .dependencies }

grunt-env { .dependency }

Loads environment variables from configuration files and applies them to the process environment.

@satisfied-by

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/grunt-env@1.0.x
tile.json