univar lets you use one script syntax for environment variables that works on macOS/Linux (bash) and Windows (cmd). It replaces $VAR and %VAR% placeholders in your commands before execution.
Without univar, these scripts behave differently:
With univar, they can be unified:
{
  "scripts": {
    "greet": "univar echo Hello $USER %USERNAME%"
  }
}On any platform:
npm run greet
# → Hello JaneDoe JaneDoenpm install univar --save-dev{
  "scripts": {
    "prebuild": "univar rimraf public/$npm_package_version",
    "build": "univar echo Building v$npm_package_version for %USERNAME%"
  }
}npm test
{ "scripts": { "bash-only": "echo Hello $USER", "win-only": "echo Hello %USERNAME%" } }