Guest User

Untitled

a guest
Jul 18th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. const fs = require('fs');
  2.  
  3.  
  4. const fileExists = path => file => fs.existsSync(`${path}/${file}`);
  5.  
  6.  
  7. const writeToPath = path => (file, content) => {
  8. const filePath = `${path}/${file}`;
  9.  
  10. fs.writeFile(filePath, content, err => {
  11. if (err) throw err;
  12. console.log("Created file: ", filePath);
  13. return true;
  14. });
  15. };
Add Comment
Please, Sign In to add comment