Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

nodejs get file stats

JS
copy
const fs = require('fs')
fs.stat('/Users/joe/test.txt', (err, stats) => {
  if (err) {
    console.error(err)
    return
  }
  //we have access to the file stats in `stats`
})
Source by nodejs.dev #
 
PREVIOUS NEXT
Tagged: #nodejs #file #stats
ADD COMMENT
Topic
Name
6+1 =