Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const fs = require('fs');
- const fileExists = path => file => fs.existsSync(`${path}/${file}`);
- const writeToPath = path => (file, content) => {
- const filePath = `${path}/${file}`;
- fs.writeFile(filePath, content, err => {
- if (err) throw err;
- console.log("Created file: ", filePath);
- return true;
- });
- };
Add Comment
Please, Sign In to add comment