UNPKG

@liplum/env

Version:

Reading and parsing environment variables from "process.env"

18 lines 500 B
import { EnvMixin } from "./shared.js"; export class IntEnv extends EnvMixin { getOrNull = (radix) => { const raw = this.env.getOrNull(); if (raw === undefined) { return this.getDefaultValue(); } return parseInt(raw, radix); }; get = (radix) => { const result = this.getOrNull(radix); if (result === undefined) { throw this.missingEnvError(); } return result; }; } //# sourceMappingURL=int.js.map