Created
April 6, 2019 18:27
-
-
Save khaosdoctor/7ac85949806b213763bfe2d5e87262e1 to your computer and use it in GitHub Desktop.
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
const fs = require('fs') | |
function callbackRead(err, dados) { | |
if (err) throw new Error(err) | |
fs.writeFile('./outroarquivo.txt', dados, callbackWrite) | |
} | |
function callbackWrite (err) { | |
if (err) throw new Error(err) | |
outraFuncaoAssincrona(callbackAsync1) | |
} | |
function callbackAsync1 (err, dados) { | |
const x = dados.split(',') | |
const y = x.map((e) => e.toUpperCase()) | |
maisUmaFuncaoAssincrona(y, callbackAsync2) | |
} | |
function callbackAsync2 (err, resultado) { | |
// ... | |
} | |
fs.readFile('./arquivo.txt', callbackRead) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment