1var fs = require("fs"); //Load the filesystem module
2var stats = fs.statSync("myfile.txt")
3var fileSizeInBytes = stats["size"]
4//Convert the file size to megabytes (optional)
5var fileSizeInMegabytes = fileSizeInBytes / 1000000.0
1var fs = require("fs"); //Load the filesystem module
2var stats = fs.statSync("myfile.txt")
3var fileSizeInBytes = stats.size;
4// Convert the file size to megabytes (optional)
5var fileSizeInMegabytes = fileSizeInBytes / (1024*1024);
6