Package

purescript-dotenv

Repository
nicholassaunders/purescript-dotenv
License
MIT
Uploaded by
nicholassaunders
Published on
2019-05-24T01:12:29Z

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