Skip to content

zayn-m/fetch-mongo-envs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

Lightweight helper library to fetch environment variables from Mongodb and set these in project.

Installing

Using npm:

$ npm install fetch-mongo-envs

Example

(async() => {
  const { Env } = require('fetch-mongo-envs');
  const env = new Env(yourMongoUri, yourModel || 'environments', codebase || 'project-name', envType || 'production');
  await env.build();
})()

Note

Document schema should be like this:

{
  codebase: "project-name",
  envType: "production",
  envs: {
    FOO: "",
    BAR: "",
    ...
  }
}

About

A library used to get envs from MongoDB

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published