dotenv-mono
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -88,2 +88,14 @@ /// <reference types="node" /> | ||
private _nodeEnv; | ||
/** | ||
* Constructor. | ||
* @param cwd - Current Working Directory | ||
* @param debug - Turn on/off debugging | ||
* @param depth - Max walking up depth | ||
* @param encoding - File encoding | ||
* @param expand - Turn on/off dotenv-expand plugin | ||
* @param extension - Add dotenv extension | ||
* @param override - Override process variables | ||
* @param path - Dotenv path | ||
* @param priorities - Priorities | ||
*/ | ||
constructor({ cwd, debug, depth, encoding, expand, extension, override, path, priorities, }?: DotenvArgs); | ||
@@ -113,2 +125,3 @@ get debug(): boolean | undefined; | ||
* @param loadOnProcess - load contents inside process | ||
* @returns current instance | ||
*/ | ||
@@ -118,2 +131,3 @@ load(loadOnProcess?: boolean): this; | ||
* Loads `.env` file contents. | ||
* @returns current instance | ||
*/ | ||
@@ -123,3 +137,3 @@ loadFile(): this; | ||
* Find first `.env` file walking up from cwd directory based on priority criteria. | ||
* @return file matched with higher priority | ||
* @returns file matched with higher priority | ||
*/ | ||
@@ -130,2 +144,3 @@ find(): string | undefined; | ||
* @param changes - data to change on the dotenv | ||
* @returns current instance | ||
*/ | ||
@@ -136,3 +151,3 @@ save(changes: DotenvData): this; | ||
* @param string - string to escape | ||
* @return escaped string | ||
* @returns escaped string | ||
*/ | ||
@@ -143,20 +158,20 @@ private escapeRegExp; | ||
* Load dotenv on process and return instance of Dotenv | ||
* @param DotenvArgs props | ||
* @return Dotenv | ||
* @param props - Configuration | ||
* @returns Dotenv instance | ||
*/ | ||
export declare function dotenvLoad(): Dotenv; | ||
export declare function dotenvLoad(props: DotenvArgs): Dotenv; | ||
/** | ||
* @see dotenvLoad | ||
*/ | ||
export declare const load: typeof dotenvLoad; | ||
export declare const load: (props: DotenvArgs) => Dotenv; | ||
/** | ||
* Load dotenv on process and return the dotenv output | ||
* @param DotenvArgs props | ||
* @return Dotenv | ||
* @param props - Configuration | ||
* @returns DotenvConfigOutput | ||
*/ | ||
export declare function dotenvConfig(): DotenvConfigOutput; | ||
export declare function dotenvConfig(props: DotenvArgs): DotenvConfigOutput; | ||
/** | ||
* @see dotenvConfig | ||
*/ | ||
export declare const config: typeof dotenvConfig; | ||
export declare const config: (props: DotenvArgs) => DotenvConfigOutput; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -15,2 +15,14 @@ "use strict"; | ||
class Dotenv { | ||
/** | ||
* Constructor. | ||
* @param cwd - Current Working Directory | ||
* @param debug - Turn on/off debugging | ||
* @param depth - Max walking up depth | ||
* @param encoding - File encoding | ||
* @param expand - Turn on/off dotenv-expand plugin | ||
* @param extension - Add dotenv extension | ||
* @param override - Override process variables | ||
* @param path - Dotenv path | ||
* @param priorities - Priorities | ||
*/ | ||
constructor({ cwd, debug, depth, encoding, expand, extension, override, path, priorities, } = {}) { | ||
@@ -107,2 +119,3 @@ this.env = {}; | ||
* @param loadOnProcess - load contents inside process | ||
* @returns current instance | ||
*/ | ||
@@ -131,2 +144,3 @@ load(loadOnProcess = true) { | ||
* Loads `.env` file contents. | ||
* @returns current instance | ||
*/ | ||
@@ -139,3 +153,3 @@ loadFile() { | ||
* Find first `.env` file walking up from cwd directory based on priority criteria. | ||
* @return file matched with higher priority | ||
* @returns file matched with higher priority | ||
*/ | ||
@@ -183,2 +197,3 @@ find() { | ||
* @param changes - data to change on the dotenv | ||
* @returns current instance | ||
*/ | ||
@@ -242,3 +257,3 @@ save(changes) { | ||
* @param string - string to escape | ||
* @return escaped string | ||
* @returns escaped string | ||
*/ | ||
@@ -252,7 +267,7 @@ escapeRegExp(string) { | ||
* Load dotenv on process and return instance of Dotenv | ||
* @param DotenvArgs props | ||
* @return Dotenv | ||
* @param props - Configuration | ||
* @returns Dotenv instance | ||
*/ | ||
function dotenvLoad() { | ||
const dotenv = new Dotenv(...arguments); | ||
function dotenvLoad(props) { | ||
const dotenv = new Dotenv(props); | ||
return dotenv.load(); | ||
@@ -267,7 +282,7 @@ } | ||
* Load dotenv on process and return the dotenv output | ||
* @param DotenvArgs props | ||
* @return Dotenv | ||
* @param props - Configuration | ||
* @returns DotenvConfigOutput | ||
*/ | ||
function dotenvConfig() { | ||
const dotenv = new Dotenv(...arguments); | ||
function dotenvConfig(props) { | ||
const dotenv = new Dotenv(props); | ||
return dotenv.load().config; | ||
@@ -274,0 +289,0 @@ } |
{ | ||
"name": "dotenv-mono", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"main": "./dist/index.js", | ||
@@ -5,0 +5,0 @@ "module": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36699
455