MCPcopy Create free account
hub / github.com/FlowiseAI/Flowise / readFile

Function readFile

packages/server/src/services/log/index.ts:8–28  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

6import readline from 'readline'
7
8const readFile = (filePath: string) => {
9 return new Promise(function (resolve, reject) {
10 const lines: string[] = []
11 var rl = readline.createInterface({
12 input: fs.createReadStream(filePath)
13 })
14
15 rl.on('line', (line) => {
16 lines.push(line)
17 })
18
19 rl.on('close', () => {
20 // Add newlines to lines
21 resolve(lines.join('\n'))
22 })
23
24 rl.on('error', (error) => {
25 reject(`Error reading file ${filePath}: ${error}`)
26 })
27 })
28}
29
30const generateDateRange = (startDate: string, endDate: string) => {
31 const start = startDate.split('-')

Callers 3

loadMethod · 0.85
loadMethod · 0.85
getLogsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected