Ensure directories and files exists or are removed in Node.js.