►
Description
Promises API in Node.js Core: Part "Do", the Update! - Joe Sepi, IBM
Speakers: Joe Sepi
Currently (Jun 1, 2019) there are only a handful of 'promisified' Node.js core APIs. But the great news is that there has been momentum building in tackling this effort and by the time of Node+JS Interactive, I expect that we will have made a lot of progress. I'd like to share with you all an update on: Where we are? What else needs to be done? And if more is needed, how can you help?
A
A
Merci,
thanks
for
coming
this
this
this
early
in
the
morning
to
hear
about
promises
in
node,
core
I,
haven't
had
the
chance
to
have
breakfast
yet
so
I
hope.
That's
you
all
are
doing
all
right
and
prepared
to
dive
in
I'll
start
off
by
saying
happy
birthday.
To
note
again,
this
is
ten
years
node
was
announced
in
2009.
A
It
was
pretty
exciting.
I.
Remember
that
those
days,
if
somebody
can
decipher
that
for
me,
I
think
it
says
happy
birthday
or
something
along
the
lines
you
know
I
might
take
a
while.
So
we'll
move
on
so
yeah
I'm
here
to
talk
to
you
about
a
core
API
is
in
node
and
what
state
they're
in
in
terms
of
being
Venable
promised
a
fide.
A
A
That
was
just
a
coincidence
just
setting
the
record
straight
here
so
yeah
anyway.
I
wanted
to
bring
my
family
cuz
Montreal
is
awesome,
but
they
couldn't
make
it
I'm
just
kidding.
That's
not
my
family.
That's
that's!
My
family
I'm
just
kidding!
That's
my
band
I
play
in
a
couple
of
bands.
That's
that's
my
punk
band!
That's
my
improv
metal
band!
These
are
actually
friends
of
mine
and
a
band
called
Built
to
Spill.
That's,
not
sam
roberts
down
in
the
corner.
A
That's
the
drummer
of
built,
a
spill
but
kind
of
looks
a
little
bit
like
I'm
right,
Sam's,
a
node
core
collaborator,
so
yeah
I
was
also
in
a
misfits
cover
band.
So
I
thought
I'd
wear
my
shirt
today,
I
realized
when
I
was
going
through
my
slides
that
I
actually
brought
this
shirt
with
me.
So
if
you're
into
misfits
come
talk
to
me
later
speaking
of
talking
to
me
later
Oh
wrong
slide.
A
If
there's
that
one's
from
Jaws
confit
you
there,
if
there's
karaoke
tonight,
definitely
give
me
a
holler,
it's
it's
it's
kind
of
a
tradition,
okay,
so
enough
of
my
digressions.
Actually,
maybe
this
is
kind
of
a
little
bit
more
of
digressing
as
well.
So
my
personal
context
with
with
promises,
is
when
I
used
to
work
the
New
York
Times
a
while
ago,
back
in
2012
I
started
doing
a
weekly,
JavaScript,
Lunch
and
Learn.
A
It
was
internal
every
Thursday
we
get
together
at
noon
and
bring
our
lunches
in
a
meeting
room
and
usually
be
like
10
to
20
people
there
that
actually
I
did
it
weekly
for
over
a
year
and
only
missed
a
couple
of
weeks,
and
it
was
largely
the
the
presenters
were
largely
internal
folks
at
the
New
York
Times,
and
it
was
a
lot
of
fun.
So
I
suggest,
if
you
you
know,
have
a
company
that
that
you're
able
to
do
that.
It's
it's
a
great
way
to
get
people
together
and
and
talk
about
tech.
A
We
did
have
a
couple
of
external
folks
come
in.
We
had
Tom,
Hughes,
croucher,
came
and
and
chatted
with
us
Rebecca
Murphy,
spike
bream
and
Dominic
D
Nicola,
so
Tom
came
and
talked
about
sockets
and
streams,
and
again
this
is
in
2012.
So
this
is
tom
toms
one
of
the
original
node
collaborators
in
the
early
days.
So
he
came
and
talked
to
us
about
sockets
and
streams,
which
was
pretty
exciting
and
Rebecca
came
and
talked
to
us
about
a
bunch
of
things,
including
the
a
query.
Has
anybody
here
ever
even
heard
of
e
a
query?
A
A
Spike
came
and
talked
to
us
about
render,
which
was
and
a
way
to
build,
isomorphic
JavaScript
applications
using
backbone
and
node,
and
it
was
pretty
exciting
at
the
time
again.
This
is
2012.
Myles
was
talking
about
universal
JavaScript
yesterday
morning
and
I
think
the
joke
was
that
he
was
like
bringing
back
ten
years
ago
or
something
and
I
really
related
to
that.
Because
of
you
know,
these
conversations
were
having
them
and
Dominic
was
working
on
the
promises.
A
A
plus
spec
at
the
time,
which
was
the
you
know,
is
the
the
the
spec
for
how
to
implement
promises,
and
so
it
was
it
was.
It
was
pretty
exciting
times,
I
even
wrote
on
the
New
York
Times
website
about
Dominic
coming
in
and
talking
to
us
and
about
the
problems
of
the
async
nightmares.
The
callback
hell
so
I
actually
am
a
published
New
York
Times
writer.
That's
all
my
resume,
not
really
so
yeah
we
were.
A
We
were
fighting
callback,
hell
back
then
still
still
are
sometimes
and
then
I
went
and
worked
at
Behance,
which
was
acquired
by
Adobe.
That's
a
Frankie,
the
dog.
He
looks
cute,
but
he's
really
serious
about
business.
You
can
tell
by
the
tie,
Christian
looks
crazy,
but
he's
also
serious
about
business,
but
when
I
got
to
be
ants,
everything
was
promised
if
I'd
and
that
was
kind
of
new
for
me,
like
all
in
whole-hog
everything
we
were.
A
A
But
again
this
was
this
was
a
while
ago
recently
Ryan
went
back
to
Jay
s
confit
you
last
year
and
had
this
real
click,
Beatty
talked
10
things
I
regret
about
nodejs,
which
was
his
way
of
introducing
Dino,
but
he
brought
up
a
lot
of
good
points,
things
that
he
had
learned
from
from
writing
node
and
one
of
them
was
regretting
taking
promises
out
of
node
in
the
early
days.
As
you
can
see
up
there,
he
says
I
added
promises
to
note
in
June
2009,
but
foolishly
removed
them
in
February,
2010.
A
He
does
go
on
to
say:
that's
perhaps
moving
removing
them
was
a
good
idea
because
it
allowed
the
community
to
work
on
the
problem
and
flesh
out
something
that
worked
better
for
for
the
community.
There
are
a
number
of
libraries
that
would
implement
promises
in
different
ways
and,
and
it
kind
of
helped
inform
you
know
where,
where
we
ended
up
landing
and
where
we
are
today,
but
he
also
says
nodes.
A
Many
async
api's
are
ageing
badly
because
of
this
and
I'm
not
sure
if
this
was
I
assumed.
This
was
out
of
the
the
talk,
but
there
was
a
bit
of
Twitter
conversation
going
on.
After
that,
you
know:
lolly
node.js,
core
modules
for
still
using
the
callback
pattern.
There
are
lots
of
laws
there,
but,
as
usual
miles
comes
to
the
rescue
and
points
out
that
a
couple
of
the
core
api's
are
actually
promised
a
fied,
including
in
this
example
FS.
A
You
and
people
were
like
what
so
he
points
out
that
FS
and
bns
have
an
experimental
promise.
Api
I,
don't
think
that's.
This
was
a
little
over
a
year
ago.
So,
that's
not
that's
that's
fully
in
there
and
then,
of
course,
you
can
see
in
the
bottom
there
that
the
puns
are
raging.
You
can't
get
away
from
them
when
you're
talking
about
promises.
A
So
I
was
talking
to
Matteo
about
this
a
few
months
ago.
I
didn't
describe
it
this
way
that
it's
an
insanely,
hard
problem,
that's
been
there
forever
and
that
we've
never
been
able
to
actually
solve
like
fully
solved
we're
working
on
it,
but
it's
taking
time
so
the
big
problem
is
promises
was
designed
for
browsers.
The
spec
was
designed
for
browsers
and
failing.
A
If
you
have
a
failing
promise,
it
only
affects
one
person
right.
You
know
in
a
browser,
you're,
unhandled,
rejection,
crashes,
your
browser,
and
you
know
it's
just
one
person,
it's
not
a
whole
a
whole
web
app.
So
if,
if
you
have
a
failing
promise,
a
node,
it
takes
down
the
whole
server,
and
so
that
affects
a
lot
more
than
one
person
and
they're
there
their
browser
tab.
A
So
if
we
look
at
an
example
of
how
this
can
happen,
we
have
a
promise
set
up
here
and
it's
immediately
immediately
resolves,
but
there's
some
JavaScript
happening
after
that,
and
we
may
never
know
you
know
if
stuff
fails
in
in
some
function
call
or
what
we
don't
really
have
access
to
that
and
in
this
example
to
the
program
ends,
and
we
have
no
way
to
get
the
the
promises
that
have
never
settled.
So
there
are
a
couple
of
challenges
there
that
really
creates
essentially
a
debugging
nightmare.
A
A
You
can
make
that
promise
a
bowl
and
events
that
on
needs
and
a
sink
or
iterator
which,
as
James
points
out
here,
it's
now
possible
to
consume
no
Jess
event,
emitter
events
using
a
sink
iterators.
Now,
if
you
saw
milestone
op
mile
some
Mateos
talk
yesterday,
there
are
still
some
problems
with
with
that.
A
That's
we're
working
on,
but
it
is
possible
if
you
take
the
right
steps,
think
and
off
those
chains
or
not,
but
somebody
was
warning
me
about
having
these
conversations
and
getting
stuck
down
the
rabbit
hole
of
micro
performance,
so
I'm
gonna
skip
this
slide.
I!
Guess
that
the
point
is:
don't
don't
obsess
about
micro
performance
if
you're,
if
you're
looking
to
solve
a
larger
problem,
so
good
news,
everyone,
let
baguette
things
are
getting
better
right.
A
A
The
collaborator
summit
after
the
event-
and
we
had
a
really
great
session
on
promises,
there's
a
lot
of
folks
there
and
a
lot
of
people
interested
and
a
lot
of
people
raising
hands
for
things
that
we're
trying
to
get
done.
And
you
know
one
of
the
discussions
was
default.
Behavior
from
for
unhandled
rejections
in
nodejs,
which
is
you
know,
a
complicated
topic
that
there
was
a
survey
going
around
and
trying
to
figure
out.
A
What's
the
best
way
to
approach
that
we
took
some
time
to
go
through
the
core,
api's
and
and
figure
out
what
the
status
is
for
for
for
each
of
them.
I
think
that
this
spreadsheet
is
online
somewhere
and
I
think
to
go
update
it
but,
like
I,
said,
there's
movement,
so
there
is
matéo
closed
a
PR
not
too
long
ago,
and
this
is
around
emitter
and
the
hope
is
that
some
work
that's
going
on
at
tc39
will
will
help
with
some
of
this
and
and
again
I.
A
A
A
Well,
I
say
this
is
really
new,
but
he
actually
opened
this
PR,
as
you
can
see,
and
in
May
it
had
been
around
a
while
and
there
were
lots
of
comments
and
updates
and
tweaks
and
stuff,
but
it
landed
about
a
week
ago.
So,
as
he
says
here,
one
of
the
biggest
source
of
issues
with
unhandled
rejection
is
the
use
of
a
vent
emitter
in
combination
with
async
functions
and
currently
there's
no
safe
way
to
to
catch
a
rejection
when
it
is
submitted
with
an
event
handler
causing
hard
to
track
bugs
and
memory
leaks.
A
The
basic
practice
right
now
is
to
wrap
stuff
in
a
try-catch
and
handle
errors.
That
way,
but
you
know
that's
problematic,
for
a
number
of
reasons,
so
as
he
in
landing
this,
there
are
some
updates
to
the
docks
as
well
and,
as
he
says
here,
using
async
functions
with
event.
Handlers
is
problematic
because
it
can
lead
to
unhandled
rejection
in
a
case
of
a
throw
and
exception.
So
this
is
similar
to
you
know
what
we're
looking
at
before,
where
you
know
we
things
get
swallowed
up
and
you
have
no
idea
what
had
happened.
A
So
this
PR
adds
a
flag
to
capture
rejections,
an
option
for
event,
emitter
constructor,
and
you
can
also
set
a
global
setting
for
a
file
to
set
it
as
well,
and
then
in
doing
that
under
the
hood,
when
the
promise
is
created,
a
dot
then
is
hand
is
added
to
it
to
to
be
able
to
handle,
rejections
and
and
surface
them.
So
that
is
good
news
right.
A
So,
like
I,
there's
movements
I
wanted
to
use
this
talk
as
a
little
bit
of
a
call
to
action.
Obviously,
if
you're
sitting
here
at
9:00
a.m.
then
you're
interested
at
in
promises
in
node
core,
so
I
want
to
point
out
that
it
is
a
strategic
initiative
at
the
TSC
is
actually
a
two
year
old
strategic
initiative.
But,
like
I
said,
there's
there's
been
progress.
A
You
know
this.
This
is
not
an
easy
problem
to
solve
in
in
some
of
the
areas
where
we're
you
know,
it
would
be
most
useful
like
like
HTTP
and
DNS
yeah
and,
like
I
said,
we've
got
we're
trying
to
manage
the
the
the
effort,
and
so
there
are
lots
of
places
where
people
can
get
involved
and
start
helping
with
it.
In
fact,
I
have
a
PR
that
I've
been
threatening
to
to
submit
for
a
while
now
to
promise
if
I
the
crypto
api's.
A
Unfortunately,
I
bought
a
house
right
around
J's
coffee.
You
and
will
this
actually
play
I,
don't
know
yeah?
Well,
that's
a
bear
in
our
yard
and
I
haven't
sold
the
old
house
yet
so
I'm
like
crazy
busy
but
I
have
a
new
year's
resolution
to
get
back
to
promises,
so
in
January,
I'm
gonna
be
back
on
the
case.
A
James
Snell
has
a
talk
after
me,
so
stick
around
and
that's
about
using
promises
and
and
some
tooling
to
to
help
you
with
using
those
and
surfacing
challenges
with
promises.
But,
generally
speaking,
you
know
come
and
talk
with
us
and
if
you're
interested
we'd
be
happy
to
have
you
helping
out
on
this
problem,
because,
with
your
help,
I
can
promise
you.
We
will
resolve
this
okay,
one
that
was
just
one
punt
at
the
end.
So
yeah
thanks.