Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

feat: provide access to multicodec #954

Merged
merged 1 commit into from
Mar 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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