🏗 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
callbackifyon API methods that return Promises to emulate previous behaviour. See the migration guide for more info. -
addnow returns an async iterable. -
addnow acceptsmodeandmtimeoptions on inputs to allow setting mode and mtime metadata for added files. See the core interface docs for more info. -
addresults now contain acidproperty (a CID instance) instead of a stringhashproperty. -
🆕
addresults now includemodeandmtimeproperties if they were set. -
addReadableStream,addPullStreamhave been removed. Please see the migration guide for more info. -
addFromStreamhas been removed. Useaddinstead. -
addFromFshas been removed. Please use the exportedglobSourceutility and pass the result toadd. See the glob source documentation for more details and an example. -
addFromURLhas been removed. Please use the exportedurlSourceutility and pass the result toadd. See the URL source documentation for more details and an example. -
bitswap.statresult has changed -wantlistand values are now an array of CID instances andpeersis now astring[]of peer IDs. -
bitswap.wantlistnow returns an array of CID instances. -
block.rmnow returns an async iterable. -
block.rmnow yields objects of{ cid: CID, error: Error }. -
block.statresult now contains acidproperty (whose value is a CID instance) instead of akeyproperty. -
dht.findProvs,dht.provide,dht.putanddht.querynow all return an async iterable. -
dht.findPeer,dht.findProvs,dht.provide,dht.putanddht.querynow yield/return an object{ id: string, addrs: Multiaddr[] }instead of aPeerInfoinstance(s). -
🆕
files.chmodhas been added. See the core interface docs for info. -
🆕
files.flushnow returns the root CID for the path that was flushed (/by default) -
files.lsPullStreamandfiles.lsReadableStreamhave been removed. Please see the migration guide for more info. -
files.lsnow returns an async iterable. -
files.lsresults now contain acidproperty (whose value is a CID instance) instead of ahashproperty. -
🆕
files.lsresults now includemodeandmtimeproperties if they were set. See the core interface docs for more info. -
files.lsno longer takes alongoption (in core) - you will receive all data by default. -
🆕
files.mkdirnow acceptsmodeandmtimeoptions to allow setting mode and mtime metadata. See the core interface docs for more info. -
files.readPullStreamandfiles.readReadableStreamhave been removed. Please see the migration guide for more info. -
files.readnow returns an async iterable. -
files.statresult now contains acidproperty (whose value is a CID instance) instead of ahashproperty. -
🆕
files.statresult now includesmodeandmtimeproperties if they were set. See the core interface docs for more info. -
🆕
files.touchhas been added. See the core interface docs for info. -
🆕
files.writenow acceptsmodeandmtimeoptions to allow setting mode and mtime metadata. See the core interface docs for more info. -
getnow returns an async iterable. Thecontentproperty value for objects yielded from the iterator is now an async iterable that yieldsBufferListobjects. -
idresult has changed, theaddressesproperty is now aMultiaddr[] -
name.resolvenow 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-lastto extract it like so:const last = require('it-last') await last(ipfs.name.resolve('/ipns/QmHash'))
-
🆕
object.getnow accepts atimeoutoption. It will cause the method to throw with aTimeoutErrorif no data is received within the timeout window. It can be passed as anumberor astring. If anumberis passed it is interpreted as milliseconds, if a string is passed it is interpreted as a human readable duration. -
lsnow returns an async iterable. -
lsresults now contain acidproperty (whose value is a CID instance) instead of ahashproperty. -
lsresults now includemodeandmtimeproperties if they were set. See the core interface docs for more info. -
pin.addresults now contain acidproperty (a CID instance) instead of a stringhashproperty. -
🆕
pin.addnow accepts atimeoutoption. It will cause the method to throw with aTimeoutErrorif no data is received within the timeout window. It can be passed as anumberor astring. If anumberis passed it is interpreted as milliseconds, if a string is passed it is interpreted as a human readable duration. -
pin.lsnow returns an async iterable. -
pin.lsresults now contain acidproperty (a CID instance) instead of a stringhashproperty. -
pin.rmresults now contain acidproperty (a CID instance) instead of a stringhashproperty. -
pingnow returns an async iterable. -
refsandrefs.localnow return an async iterable. -
🆕
refsnow accepts atimeoutoption. It will cause the method to throw with aTimeoutErrorif no data is received within the timeout window. It can be passed as anumberor astring. If anumberis passed it is interpreted as milliseconds, if a string is passed it is interpreted as a human readable duration. -
repo.gcnow returns an async iterable. -
stats.bwnow returns an async iterable. -
swarm.peersnow returns an array of objects with apeerproperty that is astring, instead of aPeerIdinstance. -
swarm.addrsnow returns an array of objects{ id: string, addrs: Multiaddr[] }instead ofPeerInfoinstances.
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.