Js-ipfs: Please consider exposing multicodec along with other dependencies

Created on 8 Mar 2019  路  6Comments  路  Source: ipfs/js-ipfs

I'm working on https://github.com/gozala/ipdf/ where I need to encode codec format in the buffer before encrypting it so during encryption I can figure out what format to use in decoding.

Provided an ipfs node instance implementation has access to everything it needs to do it's job except of multicodec that IPFS implementation internally depends upon. Please consider exposing it along with other dependencies in ipfs.types. as that would avoid pulling in separately library & any versioning mismatches that could arise from that.

P3 dieasy help wanted

All 6 comments

SGTM, what other dependencies would be useful?

SGTM, what other dependencies would be useful?

Not sure, have not come across anything else yet, I'll open separate issues if I will.

One thing that might be worth considering is to expose types / utils such that they can be accessed without instantiation of IPFS node maybe as static field on the constructor ? In lunet codebase I found myself having to pass IPFS instance to some functions just so I could use CID. I could use lazy initialization however that introduces timing and indirection that I would much rather not have to deal with.

One thing that might be worth considering is to expose types / utils such that they can be accessed without instantiation of IPFS node maybe as static field on the constructor ?

This is how it will be in 0.35 when released :D see https://github.com/ipfs/js-ipfs/pull/1908

Can I take up this issue @alanshaw ?

Yes please!

PR is ready #1921

Was this page helpful?
0 / 5 - 0 ratings