A zero-dependency template transpiler that performs shell-like variable expansion with support for default values, alternate values, and substitution operators (:- :- :+ + :? ? etc.). Inspired by Bash's Shell Parameter Expansion syntax. Current stable version is 0.0.3, released infrequently. Key differentiators: lightweight (no dependencies), TypeScript-first with bundled typings, and full support for POSIX-style expansion patterns. Unlike general template engines (e.g., Handlebars), it strictly mirrors shell semantics, making it ideal for CI/CD pipelines, configuration loaders, and environment variable interpolation.
npm install vars-expandNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates shell-like variable expansion with default values using the varsBraceExpand function.
For empty string fallback, use ${VAR:-default} only if VAR is unset; to treat empty as unset, preprocess data or use a different operator.Use String.raw`...` or escape dollar signs in JavaScript to prevent premature interpolation.
Always wrap variable names in curly braces: ${VAR}, not $VAR.Use import varsBraceExpand from 'vars-expand' or const { default: varsBraceExpand } = require('vars-expand').Provide a default value with ${VAR:-default} or ensure the variable exists in the data object.Use String.raw`...` or escape $ as \$ in the template string.
No dependency data recorded yet.