1.0.0 • Published 10 months ago

@thibaultminneboo/env-parser v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Env wrapper for NodeJS

npm install @thibaultminneboo/env-parser
  1. Examples
import { Env } from "@thibaultminneboo/env-parser";

const env = Env.create({
  PORT: "number",
  FOLLOW_REDIRECTS: "boolean",
  DATABASE_URL: "string"
});

console.log(env.get("PORT")); // throws error if PORT is not defined
console.log(env.get("DATABASE_URL", "test")); // show test if DATABASE_URL is not defined
console.log(env.get("INVALID")); // throws error because INVALID environment variable is not supported by your schema
1.0.0

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago