Tentando praticar  o que vi no curso, importo a lib fs mas quando executo recebo o erro: 
''(node:5324) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use node --trace-warnings ... to show where the warning was created)''
o código é copiado diretamente da reposição do curso
import fs from 'fs';
function trataErro(erro) {
    console.log(erro);
    throw new Error(erro.code, 'Errou!')
}
async function pegaArquivo(caminhoDoArquivo) {
    try {
        const encoding = 'utf-8';
        const texto = await fs.promises.readFile(caminhoDoArquivo, encoding)
        return extraiLinks(texto);
    } catch (erro) { trataErro(erro) }
}
pegaArquivo('./testesJS/texto.md')
 
             
            