Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Reading files with Node.js

JS
copy
const fs = require('fs')

fs.readFile('/Users/joe/test.txt', 'utf8' , (err, data) => {
  if (err) {
    console.error(err)
    return
  }
  console.log(data)
})
Source by nodejs.dev #
 
PREVIOUS NEXT
Tagged: #Reading #files
ADD COMMENT
Topic
Name
8+3 =