Skip to content

Commit

Permalink
feat: provide access to multicodec (ipfs#954)
Browse files Browse the repository at this point in the history
License: MIT
Signed-off by: Nitin Patel <[email protected]>
  • Loading branch information
niinpatel authored and Alan Shaw committed Mar 14, 2019
1 parent 6b443f0 commit 0c109ab
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 20 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ Aside from the default export, `ipfs-http-client` exports various types and util
- [`PeerInfo`](https://www.npmjs.com/package/peer-info)
- [`multiaddr`](https://www.npmjs.com/package/multiaddr)
- [`multibase`](https://www.npmjs.com/package/multibase)
- [`multicodec`](https://www.npmjs.com/package/multicodec)
- [`multihash`](https://www.npmjs.com/package/multihash)
- [`CID`](https://www.npmjs.com/package/cids)

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"lru-cache": "^5.1.1",
"multiaddr": "^6.0.0",
"multibase": "~0.6.0",
"multicodec": "~0.5.0",
"multihashes": "~0.4.14",
"ndjson": "^1.5.0",
"once": "^1.4.0",
Expand Down Expand Up @@ -181,4 +182,4 @@
"url": "https://github.com/ipfs/js-ipfs-http-client/issues"
},
"homepage": "https://github.com/ipfs/js-ipfs-http-client"
}
}
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const isIPFS = require('is-ipfs')
const CID = require('cids')
const multiaddr = require('multiaddr')
const multibase = require('multibase')
const multicodec = require('multicodec')
const multihash = require('multihashes')
const PeerId = require('peer-id')
const PeerInfo = require('peer-info')
Expand Down Expand Up @@ -60,4 +61,4 @@ function toHostAndPort (multiaddr) {

module.exports = ipfsClient

Object.assign(module.exports, { isIPFS, Buffer, CID, multiaddr, multibase, multihash, PeerId, PeerInfo })
Object.assign(module.exports, { isIPFS, Buffer, CID, multiaddr, multibase, multicodec, multihash, PeerId, PeerInfo })
18 changes: 0 additions & 18 deletions src/types.js

This file was deleted.

2 changes: 2 additions & 0 deletions test/exports.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const isIPFS = require('is-ipfs')
const CID = require('cids')
const multiaddr = require('multiaddr')
const multibase = require('multibase')
const multicodec = require('multicodec')
const multihash = require('multihashes')
const PeerId = require('peer-id')
const PeerInfo = require('peer-info')
Expand All @@ -22,6 +23,7 @@ describe('exports', () => {
expect(IpfsHttpClient.CID).to.equal(CID)
expect(IpfsHttpClient.multiaddr).to.equal(multiaddr)
expect(IpfsHttpClient.multibase).to.equal(multibase)
expect(IpfsHttpClient.multicodec).to.equal(multicodec)
expect(IpfsHttpClient.multihash).to.equal(multihash)
expect(IpfsHttpClient.PeerId).to.equal(PeerId)
expect(IpfsHttpClient.PeerInfo).to.equal(PeerInfo)
Expand Down

0 comments on commit 0c109ab

Please sign in to comment.