Complete the code to import the Node.js module for working with the file system.
const fs = require('[1]');
The fs module is used to work with the file system, including creating and removing directories.
Complete the code to create a new directory named 'myFolder' synchronously.
fs.[1]Sync('myFolder');
The mkdirSync method creates a new directory synchronously.
Fix the error in the code to remove the directory named 'oldFolder' synchronously.
fs.[1]Sync('oldFolder');
The rmSync method removes files or directories synchronously.
Fill both blanks to create a directory 'newDir' only if it does not exist.
if (!fs.existsSync('newDir')) { fs.[1]Sync('newDir', { [2]: true }); }
mkdirSync creates the directory. The option recursive: true allows creating nested directories if needed.
Fill all three blanks to remove a directory 'tempDir' and all its contents synchronously.
fs.[1]Sync('tempDir', { [2]: true, [3]: true });
rmSync removes files or directories. The options recursive: true and force: true allow deleting non-empty directories without errors.