1.0.1 • Published 4 years ago

env-analyzer v1.0.1

Weekly downloads
12
License
MIT
Repository
github
Last release
4 years ago

Env-Analyzer

NPM

The Env-Analyzer package is a simple way to parse and write .env files.

Install

npm i env-analyzer@latest

Basic stuff

const EnvAnalyzer = require('env-analyzer'); // Require the package
const Analyzer = new EnvAnalyzer({ fileName: 'some-file.env' }); // Place your file name here.

Note: fileName is required.

ExistValue()

My .env file content:

VALUE=YES

Javascript file content:

console.log(Analyzer.existsValue('VALUE'));
// Output: TRUE

GetValue()

My .env file content:

VALUE=YES

Javascript file content:

console.log(Analyzer.getValue('VALUE'));
// Output: YES

SetValue() and SaveFile()

My .env file content:

VALUE=YES

Javascript file content:

Analyzer.setValue('VALUE', 'NO');
Analyzer.saveFile();

.env file content:

VALUE=NO

If the package doesn't find the value, he will create a new one with those two values inserted.

―――――――――――――――――――――――――

If you have any problems, you can contact: RemyK#3876 Discord Server: Server Link

Made with ❤ by RemyK