0.0.1 • Published 2 years ago

dotenv-file-validator v0.0.1

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

Env file validator

The env-file-validator is a util that can be used to verify the .env file agains the .env.example file

Usage

// Import the validator
import validateEnvFile from 'env-file-validator';

// call the validator normally
validateEnvFile(true)

// call the validator with custom env file locations
validateEnvFile(true, '../.env.production', '../.env.template')

// call the validator with custom env file locations and propagated exceptions
validateEnvFile(true, '../.env.production', '../.env.template', true)

The validateEnvFile takes a few a arguments.

  • isVerbose

    • description = "Wether the logs must be shown"
    • type = boolean
    • default = false
  • envFilePath

    • description = "The .env file that will be compared against the example"
    • type = string
    • default = '.env'
  • exampleEnvFilePath

    • description = "The .env file that is used as a reference to check against"
    • type = string
    • default = '.env.example'
  • propagateError

    • description = "If set to true, instead of process.exit(-1) the exception will be thrown"
    • type = boolean
    • default = false
0.0.1

2 years ago