Environment Pack
Populate
process.env
via.env
files and at runtime.
Overview
Setup
Environment Pack
is included in the complete
and default
editions.
Current Release
npm install --save-dev @packmule/environment-pack
Nightly Build
npm install --save-dev @packmule/environment-pack@nightly
API
EnvironmentPack(path?: string)
.set(key: string, value: any)
Usage
Example
Use a .env
file per environment and set the build timestamp at build time.
import Packmule from '@packmule/core';
import EnvironmentPack from '@packmule/environment-pack';
const pack = new EnvironmentPack(`.env.${environment}`).set('TIMESTAMP', +new Date());
const packmule = new Packmule();
packmule.add(pack);
return packmule.generate();