►
Description
IPFSx is a playground, an experimental programmatic JavaScript API to IPFS. It makes use of new language features like async/await and async iterables to make programming for IPFS more ergonomic, exciting and fun.
https://github.com/ipfs-shipyard/ipfsx
A
Exciting
excellent,
okay,
so
this
is
this
is
a
quick
talk
that
I
gave
in
on
lab
week.
So
protocol
went
often
did
like
a
whole
week
together,
where
we
we
had
some
fun,
but
mostly
we
talked
about
the
future
of
ifs
and
and
all
of
that
good
stuff,
and
this
was
just
a
quick
talk
that
I
put
together
from
notes.
A
So
it's
got
to
be
fun
anyway,
if
you
like
X,
okay,
see
who
has
done
Jess
at
some
point
in
their
lives,
all
right
has
anyone
here
worked
with
the
Jess
ipfs
API,
a
few
of
you.
Okay,
this
talk
is
kind
of
for
you.
Who's
worked
with
Jess
ipfs,
some
people,
okay,
the
rest
of
you.
This
talk
is
even
more
for
you,
because
you're
going
to
learn
something.
A
A
How
can
the
ipfs
API
be
a
bit
more
appealing
to
programmers
I
believe
that
we
can
make
it
easier
to
program
for
RDFS
I
believe
that
programming
for
ipfs
can
be
more
enjoyable
and
I
believe
that
programming
for
ipfs
can
be
more
exciting
and
I
believe
that
solving
these
these,
these
problems
can
encourage
developers
to
use
ipfs
even
more,
and
so
what
I'm
thinking
about
is
like
if
I
were
gonna,
be
coding
and
getting
stuff
out
of
ipfs
of
putting
stuff
into
it.
What
is
the
kind
of
API
that
I'd
like
to
use
like
it?
A
What
would
I
code?
What
would
what
would
be
the
best
thing,
the
kind
of
like
dream
code
that
I
would
like
to
use,
and
so
the
thing
is
I.
Don't
want
to
just
change
things
on
a
whim
like
there's,
there's
been
a
whole
bunch
of
work
put
into
like
interfaces
and
code
that
is
implementing
these
interfaces
and
ipfs
is
is
like
all
callbacks.
It's
all.
A
Well,
if
I'm
gonna,
if
I'm
going
to
even
propose
anything,
that's
slightly
different
to
what's
there
I
should
have
some
bloody
good
reasons
for
doing
it,
and
then
I
came
up
with
a
few
reasons
and
I
came
out
with
even
more
reasons
and
then
I,
just
kind
of
kept
going
and
so
yeah
there's
an
increasingly
large
set
of
reasons
to
maybe
change
some
things,
and
so
this
is
about
improving
developer
experience
and
I.
So
what
I
did
I
created
a
repo
of
course
and
I
created
a
repo
called
ipfs
X?
A
It's
an
experimental
playground
for
playing
around
with,
like
the
programmatic
API,
for
talking
to
ipfs
and
what
it
is
is
it's
just
a
mapping
layer
between
the
API,
the
the
iOS
API
JSI,
PFS,
API
exposes
or
chess
exposes,
and
the
API
that
I
want
to
that.
I
would
like
to
see
and
one
of
the
biggest
so
it's
it's
basically
I
all
like
async
away,
but
the
biggest
difference
is
making
use
of
async
iterators
I'm,
probably
not
going
to
go
over
this
because
we're
kind
of
short
time.
A
But
what
is
async
it
Rea
is
well
bla,
bla,
bla,
bla,
bla,
bla,
ok,
basically,
a
native
language
feature
that
allows
us
to
to
to
stream
data,
which
is
super
super
rad
and
right
now,
like
most
of
the
web
browsers
most
of
javascript,
like
runtimes,
all
implement
a
teasing
Kuwait.
They
all
increment
implement
async
iterators.
So
now
it's
quite
a
good
time
to
do
it.
A
If
we
were
because
there's
no
need
to
transpile-
and
we
don't
transpile
anything
at
the
moment-
which
is
super
rad,
because
it's
just
complicated
when
dealing
with
errors
and
things
like
that,
so
so
yeah
no
transport
cool
and
it
means
that
we
don't
need
to
use
nodejs
streams
or
pull
streams
anymore
and
and
for
that
matter.
A
If
there's
many
parallels,
I
yeah,
there's
obvious
obvious
differences,
but
anyway,
and
the
cool
thing
is,
if
you're
using
nodejs
streams,
there's
no
real
kind
of
like
upgrade
path,
because
no
js'
streams
are
now
async
iterables
as
well.
So
you
can
just
pass
that
in
as
an
argument
to
many
of
these
functions
and
what's
kind
of
cool
is
that
if
you've
ever
used,
the
Jess
I've
FS
API
we've
got
like.
We've
got
big
API
surface
area.
We've
got
like
three
different
ways
of
adding
content.
A
They
basically
do
the
same
thing
but
they're
like
they're,
add
which
also
takes
streams.
I
had
pull
stream
for
like
getting
a
pulse
cream
and
putting
stuff
through
it
and
add
readable
stream
for
like
a
node.js
stream.
So
we
don't
have
this.
This
kind
of
big
API
surface
area
anymore,
and
that
means-
and
it
means
that
we
don't
need
to
import
modules
to
like
by
the
pull
stream
module.
It's
ecosystem
modules
like
for
other
things.
You
might
want
to
do
with
pull
streams.
You
don't
need
to
for
the
browser
import
stuff
like
readable
stream.
A
You
don't
need
like
pump
to
deal
with
errors
in
a
pot
in
a
stream
pipeline
so
that
all
contributes
to
a
smaller
bundle.
Fewer
dependency
is
quicker
to
install
super
win-win-win
and
because
we've
got
a
smallest
API
surface
area
there.
For
your
tests
to
run,
we
don't
have
to
test
all
these
different
combinations
of
adding
because
there's
only
going
to
be
one
add
command,
which
is
which
will
take
a
bunch
of
different
arguments
but
but
yeah
fewer
tests
to
run.
A
A
So
it's
a
lot
easier
for
me
to
do
that
if
I
wanted
to
and
then
JSI
PFS
is
basically
all
pool
streams
under
the
hood
and
then,
but
then,
when
we
do
expose
like
an
odious
stream
API,
it's
it's
there's
boilerplate
converting
between
cool
streams,
readable
streams
and
we
need
to
import
those
modules.
And
now
we
don't
need
them,
so
we
can
get
rid
of
them.
Smaller
bundle,
less
code.
You
know
those
sort
things
and
one
of
the
big
big
cool
things
about
async
it
rules
and
for
a
weight
of
loops.
A
Is
it's
easier
to
error
handler
stuff
we
don't
have
to
have
like
a
full
stream.
Has
a
really
good
way
of
dealing
with
this
is
in
your
in
your
sink.
You
have
like
a
callback
with
if
you're
collecting
stuff,
then
you
have
a
Kulak
with
an
error
and
errors
are
propagated
up
and
down
really
well
and
easy
to
catch,
but
in
nodejs
streams.
If
you
have
like
pipe,
you
need
another
module
to
listen
for
all
the
errors,
and
you
don't
know
and
and
propagating
those
through
to
the
end.
A
A
So
the
problem
with
like
callbacks
and
and
like
streams
and
and
all
of
that
is
that
when
you
get
stack
traces,
you
get
stack
traces
that
sometimes
don't
have
any
of
your
code
in
them
and
that's
really
frustrating
because
they're
clips
it
like
async
boundaries
and
with
with
async
away.
You
don't
get
that
problem.
So
it's
easier
to
debug
and
it's
a
better
developer
experience.
Okay,
that
was
super
Whistlestop
cool,
and
what
do
they
look
like?
What
is
it
like?
Okay?
A
So
if
I'm
going
to
create
an
IP
FS
node,
now
we
just
have
to
pass
a
ipfs,
a
regular
ipfs
or
a
ipfs
api
to
my
PFS
X
with
ipfs.
You
usually
have
to
wait.
You're
certain
event
emitting
you
have
to
wait
for
a
ready
event
before
you
can
use
it.
One
of
the
things
that
IVF
SX
does,
which
makes
things
a
little
bit
easier,
as
we
can
just
a
wait
for
that
thing
to
be
ready,
and
now
we
can
use
it.
A
We
don't
have
to
like
if
you
are
basically,
if
you're,
using
IP,
FS
you'll,
probably
write
a
little
kind
of
helper
function
which
allows
you
to
wait
for
it,
and
this
just
means
that
it's
done
once
in
ipfs,
it's
tested.
It's
done
right
and
there's
less
that
people
just
don't
implement
this
over
and
over
again.
So
so
that
kind
of
fun.
Adding
content
is
soup,
easy.
You
just
call,
no
dad!
A
You
can
give
it
a
string
previously,
you'd
have
to
give
it
a
buffer,
which
meant
you
had
to
find
some
sort
of
buffer
implementation
somewhere,
give
it
a
string,
and
it
will
add
that
and
then
we
can
use
this
magical
for
await,
because
what
it
does
is
no
dad
just
returns
straight
away,
an
async
iterator,
and
then
we
can
iterate
over
the
the
the
whatever
comes
out
of
the
other
end.
Once
it's
adding
this
content-
and
in
this
case
it's
gonna,
add
one
thing
and
you're
going
to
get
a
CID
for
whatever
it
creates.
A
So
that's
kind
of
frustrating.
So
there's
this
there's
a
shorthand
where
each
iterator
that
we
return
has
like
a
first
and
a
last
method,
and
so,
if
you're,
adding
one
thing,
you
know,
there's
only
gonna
be
one
thing
return.
Then
you
can
just
a
wait
on
the
first
item.
It's
going
to
be
all
the
last
item.
That's
going
to
come
out
of
that
iterator.
So
so
that's
kind
of
fun
and
then
so
I
said
earlier.
The
nodejs
streams,
our
async
iterators
too.
A
We
can
just
add
a
no
jet
stream
to
add
to
add
content
because
add
takes
an
interest,
so
it
takes
strings,
it
takes
buffers
or
it
takes
iterators
or
async
iterators
and
so
create
mutable.
Three
crate
read
stream.
It
returns
a
async
iterator.
So
you
can
just
add
that
and
if
you
want
to
add
multiple
things,
then
you
also
you
give
it
an
array
is
an
is
an
iterator
there's
lots
of
things
in
JavaScript
that
we
should
already
iterators
array
objects.
A
Map
sets
array
is
one
of
them,
so
we
just
iterate
over
this
and
then
our
content
is
and
it
can
be,
a
string,
a
buffer
or
an
iterator
or
async
iteration.
So
then,
then,
this
becomes
more
useful
here
because
now
we're
looping
over
and
we
can
collect
up
our
whatever
comes
out
of
our
of
our
async
iterator
here.
So
so
that's
kind
of
fun,
and
so
you
can
use
generators
to
create
your
own
iterator.
If
you
want
so
this
will
this
will
so
generators
when
you
call
them
will
return
something
an
iterable
and
you
can.
A
A
So
we're
saying
it's
an
async
generate
an
async
iterator
to
be
returned
and
instead
of
yielding
some
a
value,
a
yield,
a
promise
which
results
to
a
value.
So
anyway,
that's
kind
of
just
for
fun,
you'd,
normally
just
kind
of
get
hold
of
that
something
to
add
and
then
just
add
it
and
once
you've
added
stuff
you're,
probably
gonna
want
to
cut
it
out.
So
you
just
get
the
cid
and
then
we've
got
something
similar.