News for hackers. Stuff that matters.
Re:Node v8.0.0 Released by p5k on Tuesday May 30, 2017 @05:33PM (#14448721)
Notejs should get promise versions of its current callback-based APIs:

    const fs = require("fs");
    fs.writeFile("Hello, World", "helloworld.txt", (error)=>{
        if(error) throw error;
        console.log("done!");
    });
Should be:

    const fs = require("fs");
    fs.writeFilePromise("Hello, World", "helloworld.txt").then(()=>console.log("done!"),error=>console.error(error));
Re:Node v8.0.0 Released by flavio81 on Wednesday May 31, 2017 @03:26AM (#14450920)
It really should be:

   try{
        x = await fs.writeFilePromise("Hello, World", "helloworld.txt")
        console.log("done!")
   }
   catch(error)
   {
        console.error(error) // or console.log
   }
This takes advantage of promises fully.
Re:Node v8.0.0 Released by __s on Tuesday May 30, 2017 @06:21PM (#14449026)
Re:Node v8.0.0 Released by STRML on Tuesday May 30, 2017 @07:45PM (#14449487)
This was tried many years ago. At that time, Promises/A+ was not finalized, and the community could not agree on which Promise specification was best, or even if one was needed at all.

Callbacks are lightest-weight re: CPU & memory overhead, so it was decided that core APIs should implement that, and developers can override using promisify (via e.g. Bluebird or the new `util.promisify()`) as they need. But putting that kind of assumption in core could lead to significant pain.