Node.js stats.blocks Property from fs.Stats Class
The stats.blocks property is an inbuilt application programming interface of the fs.Stats class is used to get the number of blocks allocated for the file.
Return Value: It returns a number or BigInt value that represents the number of blocks allocated for the file.
Below examples illustrate the use of stats.blocks property in Node.js:
using stat: 8 using lstat: 8
using stat synchronous: 8
Note: The above program will compile and run by using the
node filename.js command and use the file_path correctly.