This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { promises as fs } from 'fs'; | |
import { EOL } from 'os'; | |
export class SomeClass { | |
async asyncFileWriteJSON<T>(listOfObjects: Array<T>, filename: string): Promise<void> { | |
try { | |
if (listOfObjects && listOfObjects.length > 0) { | |
const file = filename; | |
let fd = await fs.open(file, 'w'); |