NodeJS: Difference between revisions

1 byte added ,  25 September 2019
No edit summary
Line 27: Line 27:
// Synchronous functions
// Synchronous functions


// Only in fs-extra
//// Only in fs-extra
 
// Remove file or folder (rm -rf)
// Remove file or folder (rm -rf)
// Does nothing if path doesn't exist
// Does nothing if path doesn't exist
Line 37: Line 36:
fs.ensureDirSync('/tmp/folder1/folder2');
fs.ensureDirSync('/tmp/folder1/folder2');


 
//// Available in node's native 'fs'
// Available in node's native 'fs'
 
// List all files and folders in a directory
// List all files and folders in a directory
fs.readdirSync('/tmp');
fs.readdirSync('/tmp');