Merge pull request #450 from MetCoder95/dotenv-interface · motdotla/dotenv@7301ac9

2 files changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -55,5 +55,12 @@ export interface DotenvConfigOutput {

5555

*

5656

*/

5757

export function config(options?: DotenvConfigOptions): DotenvConfigOutput;

58+
59+

/** dotenv library interface */

60+

export interface DotEnv {

61+

config: typeof config;

62+

parse: typeof parse;

63+

}

64+
5865

/** @deprecated since v7.0.0 Use config instead. */

5966

export const load: typeof config;

Original file line numberDiff line numberDiff line change

@@ -1,4 +1,9 @@

1-

import { config, parse } from "dotenv";

1+

import * as dotenv from "dotenv";

2+
3+

const { config, parse }: dotenv.DotEnv = {

4+

config: dotenv.config,

5+

parse: dotenv.parse

6+

};

27
38

const env = config();

49

const dbUrl: string | null =