Posts for: #nodejs

Promise-based filesystem APIs in Node 10

Promise-based filesystem APIs in Node 10
Almost one year ago, Node 8 was released. It was a major release and brought quite a bit of ESnext to the masses. Even then, back in June I recognized that one of the major pitfalls when working with Node are the callback-based APIs that (IMHO) pollute your code. Somewhat hidden in that release, was util.promisify, a native way of converting an errback (or Node-style callback) into a Promise. A Promise-based fs As Node 10 just landed a few days ago, I was excited to see the most common case for such an util (dealing with filesystem APIs) was being addressed in some fashion.
Read more