Published
- 1 min read
nodejs fs write line
The solution for this is noted below
nodejs fs write line
Solution
import fs from 'fs'
const fileWritter = fs.createWriteStream('./users-data.txt' {
flags: 'a' // 'a' means appending (old data will be preserved)
})
// Will append one line to the file
fileWritter.write(JSON.stringify({
}))
Try other methods by searching on the site. That is if this doesn’t work