🏗 API Changes
There are significant and breaking API changes in this release. Please see the migration guide.
-
Callbacks are no longer supported on any API methods. Please use a utility such as
callbackify
on API methods that return Promises to emulate previous behaviour. See the migration guide for more info. -
add
now returns an async iterable. -
add
now acceptsmode
andmtime
options on inputs to allow setting mode and mtime metadata for added files. See the core interface docs for more info. -
add
results now contain acid
property (a CID instance) instead of a stringhash
property. -
🆕
add
results now includemode
andmtime
properties if they were set. -
addReadableStream
,addPullStream
have been removed. Please see the migration guide for more info. -
addFromStream
has been removed. Useadd
instead. -
addFromFs
has been removed. Please use the exportedglobSource
utility and pass the result toadd
. See the glob source documentation for more details and an example. -
addFromURL
has been removed. Please use the exportedurlSource
utility and pass the result toadd
. See the URL source documentation for more details and an example. -
bitswap.stat
result has changed -wantlist
and values are now an array of CID instances andpeers
is now astring[]
of peer IDs. -
bitswap.wantlist
now returns an array of CID instances. -
block.rm
now returns an async iterable. -
block.rm
now yields objects of{ cid: CID, error: Error }
. -
block.stat
result now contains acid
property (whose value is a CID instance) instead of akey
property. -
dht.findProvs
,dht.provide
,dht.put
anddht.query
now all return an async iterable. -
dht.findPeer
,dht.findProvs
,dht.provide
,dht.put
anddht.query
now yield/return an object{ id: string, addrs: Multiaddr[] }
instead of aPeerInfo
instance(s). -
🆕
files.chmod
has been added. See the core interface docs for info. -
🆕
files.flush
now returns the root CID for the path that was flushed (/
by default) -
files.lsPullStream
andfiles.lsReadableStream
have been removed. Please see the migration guide for more info. -
files.ls
now returns an async iterable. -
files.ls
results now contain acid
property (whose value is a CID instance) instead of ahash
property. -
🆕
files.ls
results now includemode
andmtime
properties if they were set. See the core interface docs for more info. -
files.ls
no longer takes along
option (in core) - you will receive all data by default. -
🆕
files.mkdir
now acceptsmode
andmtime
options to allow setting mode and mtime metadata. See the core interface docs for more info. -
files.readPullStream
andfiles.readReadableStream
have been removed. Please see the migration guide for more info. -
files.read
now returns an async iterable. -
files.stat
result now contains acid
property (whose value is a CID instance) instead of ahash
property. -
🆕
files.stat
result now includesmode
andmtime
properties if they were set. See the core interface docs for more info. -
🆕
files.touch
has been added. See the core interface docs for info. -
🆕
files.write
now acceptsmode
andmtime
options to allow setting mode and mtime metadata. See the core interface docs for more info. -
get
now returns an async iterable. Thecontent
property value for objects yielded from the iterator is now an async iterable that yieldsBufferList
objects. -
id
result has changed, theaddresses
property is now aMultiaddr[]
-
name.resolve
now returns an async iterable. It yields increasingly more accurate resolved values as they are discovered until the best value is selected from the quorum of 16. The "best" resolved value is the last item yielded from the iterator. If you are interested only in this best value you could useit-last
to extract it like so:const last = require('it-last') await last(ipfs.name.resolve('/ipns/QmHash'))
-
🆕
object.get
now accepts atimeout
option. It will cause the method to throw with aTimeoutError
if no data is received within the timeout window. It can be passed as anumber
or astring
. If anumber
is passed it is interpreted as milliseconds, if a string is passed it is interpreted as a human readable duration. -
ls
now returns an async iterable. -
ls
results now contain acid
property (whose value is a CID instance) instead of ahash
property. -
ls
results now includemode
andmtime
properties if they were set. See the core interface docs for more info. -
pin.add
results now contain acid
property (a CID instance) instead of a stringhash
property. -
🆕
pin.add
now accepts atimeout
option. It will cause the method to throw with aTimeoutError
if no data is received within the timeout window. It can be passed as anumber
or astring
. If anumber
is passed it is interpreted as milliseconds, if a string is passed it is interpreted as a human readable duration. -
pin.ls
now returns an async iterable. -
pin.ls
results now contain acid
property (a CID instance) instead of a stringhash
property. -
pin.rm
results now contain acid
property (a CID instance) instead of a stringhash
property. -
ping
now returns an async iterable. -
refs
andrefs.local
now return an async iterable. -
🆕
refs
now accepts atimeout
option. It will cause the method to throw with aTimeoutError
if no data is received within the timeout window. It can be passed as anumber
or astring
. If anumber
is passed it is interpreted as milliseconds, if a string is passed it is interpreted as a human readable duration. -
repo.gc
now returns an async iterable. -
stats.bw
now returns an async iterable. -
swarm.peers
now returns an array of objects with apeer
property that is astring
, instead of aPeerId
instance. -
swarm.addrs
now returns an array of objects{ id: string, addrs: Multiaddr[] }
instead ofPeerInfo
instances.
Other changes
- The protocol name for peer IDs in multiaddrs has changed from 'ipfs' to 'p2p'. There's no changes to data on the wire but this change is seen when multiaddrs are converted to strings.