Package

purescript-node-dotenv

Repository
nicholassaunders/purescript-node-dotenv
License
MIT
Uploaded by
nicholassaunders
Published on
2019-04-09T15:41:25Z

Load environment variables from a .env file.

This is a lightweight clone of various dotenv projects like this Haskell version or this JavaScript version.

Overview

A .env file looks like this:

DATABASE_HOST=127.0.0.1
DATABASE_PORT=3131
DATABASE_USER=happydude
DATABASE_PASS=password

Simply drop the .env file in the root of your project (ensuring for security reasons not to commit it), and then call Dotenv.loadFile at the beginning of your program. Environment variable lookups will then fall back to the values defined in .env.

Example

To run the example:

pulp run -I example --main Example.Main