79365045

Date: 2025-01-17 14:28:39
Score: 1.5
Natty:
Report link

Can't believe Node.js makes you do this kind of nonsense in 2025.

function readAsync(fileName) {
      return new Promise((resolve, reject) => {
        const file = fs.open(fileName, "r", (data, err) => {
          if (err) {
            console.error(err);
          }

          if (data) {
            resolve(data);
          }
        });
      });
    }

    const file = readAsync(fileName);
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Starts with a question (0.5): Can't
  • Low reputation (1):
Posted by: jurijus01