(filePath: string)
| 69 | * @returns Parsed environment variables |
| 70 | */ |
| 71 | export async function readDotEnv(filePath: string): Promise<dotenv.DotenvParseOutput> { |
| 72 | try { |
| 73 | const content = await fs.readFile(filePath, 'utf-8') |
| 74 | return dotenv.parse(content) |
| 75 | } catch (error) { |
| 76 | if (isErrnoENOENT(error)) { |
| 77 | return {} |
| 78 | } |
| 79 | throw error |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | /** |
| 84 | * Update a .env file with new values. |
no test coverage detected