Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 1x 1x 1x 1x 1x | import fs from 'fs' export function createFile(fileName, data) { try { fs.writeFile(`${process.cwd()}/${fileName}`, data, 'utf8', function (err) { Iif (err) { throw new Error(err) } console.log('\x1b[32m', `Your file has been saved in ${process.cwd()}/output/${fileName}.`); }); } catch (err) { console.error(err) } } |