Last active
February 11, 2021 02:08
-
-
Save FagnerMartinsBrack/ae14a1859cf201391ad4e4dcc2a7526b to your computer and use it in GitHub Desktop.
(Medium) Why Small Modules Matter - End Usage
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
const flattenArrayInsideFile = require("./flatten-array-inside-file"); | |
flattenArrayInsideFile("file.txt") | |
.then(function() { | |
// Do something after | |
}) | |
.catch(function(error) { | |
// Handle error | |
}); | |
//async/await | |
try { | |
await flattenArrayInsideFile("file.txt"); | |
// Do something after | |
} catch(error) { | |
// Handle error | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment