Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to right plain text format file in node js

var fs = require('fs')
var logger = fs.createWriteStream('log.txt', {
  flags: 'a' // 'a' means appending (old data will be preserved)
})

logger.write('some data') // append string to your file
logger.write('more data') // again
logger.write('and more') // again
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #plain #text #format #file #node #js
ADD COMMENT
Topic
Name
7+5 =