envcrud

1.1.0 • Public • Published

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})
})

Readme

Keywords

none

Package Sidebar

Install

npm i envcrud

Weekly Downloads

1

Version

1.1.0

License

MIT

Last publish

Collaborators

  • genecyber