Created
October 17, 2016 08:30
-
-
Save legend80s/e40a1cbf241a281a86b86fe3ad2ec29d to your computer and use it in GitHub Desktop.
thunks for fs
This file contains hidden or 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
// https://github.com/tj/co-fs/blob/master/index.js | |
const fs = require('fs'); | |
function accessThunk(dir) { | |
return (cb) => { | |
fs.access(dir, (err) => cb(null, !err)); | |
}; | |
} | |
function mkdirThunk(dir) { | |
return (cb) => { | |
fs.mkdir(dir, (err) => cb(null, !err)); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment