Skip to content

Instantly share code, notes, and snippets.

@scripting
Last active August 25, 2022 02:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scripting/4a7db1758915a48c321e8752406f1c65 to your computer and use it in GitHub Desktop.
Save scripting/4a7db1758915a48c321e8752406f1c65 to your computer and use it in GitHub Desktop.
Verbs for Electric Drummer
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