dotenv-constraint
Version:
A lightweight package to enforce constraints on environment variables in JavaScript, ensuring required variables are defined and match expected types.
23 lines (21 loc) • 583 B
TypeScript
type dotenvErrorsCode = 'empty' | 'invalid_type' | 'file_not_found' | 'missing' | 'duplicate' | 'not_in_schema';
type dotenvErrors = {
code?: dotenvErrorsCode;
variable?: string;
expected?: string;
};
type dotenvResult = {
errors: dotenvErrors[];
success: boolean;
};
declare const validateEnv: (config?: {
dotenvPath?: string;
schemaPath?: string;
}) => dotenvResult;
declare const _default: {
validateEnv: (config?: {
dotenvPath?: string;
schemaPath?: string;
}) => dotenvResult;
};
export { _default as default, validateEnv };