Node8’s util.promisify is so freakin’ awesome!

James Jeffery
Sep 27, 2017 · 4 min read
Image for post
Image for post

TLDR;

What does util.promisify do?

Creating a Regular Function

NodeJS Callback Style

callback(null, ‘Congratulations, you have finished waiting.’);
callback(‘Could not wait any longer!’, null);

Usage

Test Running

Promisify Regular Functions

Introducing Async and Await

😊

HackerNoon.com

#BlackLivesMatter

By HackerNoon.com

how hackers start their afternoon. the real shit is on hackernoon.com. Take a look

Create a free Medium account to get DONT SIGN UP FOR THIS NEWSLETTER in your inbox.

James Jeffery

Written by

Software Developer, Security Research, Music Production, Live Coding. Follow me on Twitter: @EDMTheory

HackerNoon.com

Elijah McClain, George Floyd, Eric Garner, Breonna Taylor, Ahmaud Arbery, Michael Brown, Oscar Grant, Atatiana Jefferson, Tamir Rice, Bettie Jones, Botham Jean

James Jeffery

Written by

Software Developer, Security Research, Music Production, Live Coding. Follow me on Twitter: @EDMTheory

HackerNoon.com

Elijah McClain, George Floyd, Eric Garner, Breonna Taylor, Ahmaud Arbery, Michael Brown, Oscar Grant, Atatiana Jefferson, Tamir Rice, Bettie Jones, Botham Jean

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store