Skip to content

Instantly share code, notes, and snippets.

@Bamblehorse
Last active July 18, 2018 17:57
Show Gist options
  • Save Bamblehorse/ab858cd8343e50036f229334d340421f to your computer and use it in GitHub Desktop.
Save Bamblehorse/ab858cd8343e50036f229334d340421f to your computer and use it in GitHub Desktop.
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;
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment