(filePath: string, append = false)
| 9 | private writeStream: fs.WriteStream; |
| 10 | |
| 11 | constructor(filePath: string, append = false) { |
| 12 | if (append) { |
| 13 | this.writeStream = fs.createWriteStream(filePath, { |
| 14 | flags: 'a', |
| 15 | encoding: 'utf-8', |
| 16 | highWaterMark: 64 * 1024 // 64 KB, you can adjust this value as needed |
| 17 | |
| 18 | }); |
| 19 | } else { |
| 20 | this.writeStream = fs.createWriteStream(filePath, { |
| 21 | encoding: 'utf-8', |
| 22 | highWaterMark: 64 * 1024 // 64 KB, you can adjust this value as needed |
| 23 | }); |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | async push(data: any): Promise<void> { |
| 28 | return this.performWrite(JSON.stringify(data) + '\n'); |
nothing calls this directly
no outgoing calls
no test coverage detected