rarepress / nebulus

Virtual IPFS
https://nebulus.dev
MIT License
263 stars 15 forks source link

Alias methods addition (wrt git analogy): ipfs.push & ipfs.pull #2

Closed skogard closed 3 years ago

skogard commented 3 years ago

d

Currently the API exposes nebulus.ipfs.upload and nebulus.ipfs.download methods.

But thinking of the git analogy, it might be intuitive to add alias for both upload and download so that:

Would be kind of like git.

Additionally, the event emitters would emit the events:

nebulus.ipfs.on("push", (cid) => {
  // do something with cid
})

and

nebulus.ipfs.on("pull", (cid) => {
  // do something with cid
})
skogard commented 3 years ago

This has been implemented.

It's backwards compatible so the previous API can still be used, but now the recommended way is to use the unified nebulus object for everything.

See https://github.com/skogard/nebulus/commit/a901ff6edacc7f04cd9692a57049ee69d8ab869c