-
-
Save techwraith/8660828 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function (path, opts) { | |
return function (err, src) { | |
if (!opts) opts = {} | |
if (!path) throw new Error('Path must be provided') | |
if (err) { | |
throw err | |
} | |
fs.writeFileSync(path, src, 'utf8'); | |
if (opts.debug) console.log('writing to ' + path) | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
to use: