Skip to content

Commit

Permalink
Merge pull request #5 from GustavoBonfimS/develop
Browse files Browse the repository at this point in the history
v1.0.2
  • Loading branch information
GustavoBonfimS authored May 16, 2022
2 parents 6c5cb7d + 4dff389 commit 29fab05
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
APP_PORT=

API_BASE_URL=
API_TOKEN=
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ Or
sev --help
```

### Error
You can pass --error or -e to throw an error if some key is missing in .env

### Output example

![output image](/src/resources/screenshot.png "output example")
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
"name": "simple-env-verify",
"version": "1.0.1",
"version": "1.0.2",
"main": "src/index.mjs",
"author": "Gustavo Bonfim",
"license": "MIT",
"keywords": ["env", "verify", "env-verify"],
"scripts": {
"dev": "node src/index.mjs --env .env --example .env.example"
},
"repository": {
"type": "git",
"url": "https://github.com/GustavoBonfimS/simple-env-verify"
Expand Down
2 changes: 1 addition & 1 deletion src/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ async function main() {
const { log } = console;

const options = yargs
.usage('Usage: envy-verify --example <.env.example> --env <.env>')
.usage('Usage: simple-env-verify --example <.env.example> --env <.env>')
.option('example', {
alias: 'ex',
describe: 'Your .env example file',
Expand Down
4 changes: 3 additions & 1 deletion src/utils/readEnv.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import LineByLine from 'line-by-line';

function readEnv(filePath) {
return new Promise((resolve, reject) => {
const lr = new LineByLine(filePath);
const lr = new LineByLine(filePath, {
skipEmptyLines: true,
});

const envObj = {};

Expand Down

0 comments on commit 29fab05

Please sign in to comment.