1.1.0 • Published 8 years ago

envcrud v1.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

envcrud

Node module to manage .env file Includes small example webserver to demonstrate use via REST

Use

npm install https://github.com/genecyber/envcrud.git

npm start

> node server.js

Running on http://localhost:3002
var Env = require("envcrud").Env
var env = new Env(".env")

List all entries

env.loadVariables(function(envArray){
    console.log(envArray)
})

Get single entry

env.getVariable("foo", function(value){
    console.log({env: value})
})

Add or update entry

env.AddOrUpdate("foo", "new bar", function(newVar){
    console.log({success: true, msg: newVar})
})

Delete an entry

env.Delete("foo", function(msg){
    console.log({success: true, msg: msg})
})