Last active
August 25, 2022 02:42
-
-
Save scripting/4a7db1758915a48c321e8752406f1c65 to your computer and use it in GitHub Desktop.
Verbs for Electric Drummer
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
localfile = { //verbs for Electric Drummer | |
read: function (path) { | |
return new Promise (function (resolve, reject) { | |
fs.readFile (path, function (err, data) { | |
if (err) { | |
reject (err); | |
} | |
else { | |
resolve (data); | |
} | |
}); | |
}); | |
}, | |
write: function (path, data) { | |
return new Promise (function (resolve, reject) { | |
fs.writeFile (path, data, function (err) { | |
if (err) { | |
reject (err); | |
} | |
else { | |
resolve (true); | |
} | |
}); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment