File System eXtension for NodeJS
npm install node-fsx
Class FileInfo provides information functions for a file:
- exists()
- creationTime()
- size()
- absPath()
- isFile()
- isDirectory()
Module temp provides functions for temporary files:
- getTempDir() - returns system temp directory
- getTempFileName(fileName) - returns full path to file in the system temporary directory
- createTempFileName(prefix,extension) - generates unique file name in the system temporary directory
const fsx = require('node-fsx');
let fi = new fsx.FileInfo('file name is here');
console.log(fi.exists());
console.log(fi.creationTime());
console.log(fi.size());
console.log(fi.absPath());
console.log(fi.isFile());
console.log(fi.isDirectory());
const fsx = require('node-fsx');
console.log(fsx.getTempDir());
console.log(fsx.getTempFileName('temp.csv'));
console.log(fsx.createTempFileName('test', '.csv'));