Skip to content
forked from crowlKats/denv

A module similar to dotEnv, but for Deno

License

Notifications You must be signed in to change notification settings

halvardssm/denv

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

denv

A module similar to dotenv, but for Deno

Usage

You can import the load function which will use the .env file from the current directory, or you can pass the path to an env file. Here is an example with all default values:

import { load } from "https://deno.land/x/denv@3.0.0/mod.ts";
await load({
  /** The path of the env file, defaults to ".env" */
  path: ".env",
  /** If true, won't overwrite existing variables */
  priorityEnv: false,
  /** Will not throw an error if file is not found */
  ignoreMissingFile: false,
  /** If true, will verify the final environment against the example file */
  verifyAgainstExample: false,
  /** If true, will fallback to the example file */
  defaultToExample: false,
  /** Path to example file, defaults to ".env.example" */
  exampleFile: ".env.example",
});

Env File Rules

The rules are the same as dotenv, except double quoted values expand new lines is not implemented

About

A module similar to dotEnv, but for Deno

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 98.9%
  • Shell 1.1%