Skip to content

v6.0.0

@rvagg rvagg tagged this 31 Mar 06:37
The following commit message is mostly copied from cea9063c:

feat!: named exports instead of default exports

It also removes the `Codec` class and exports a plain object
instead. This has consequences for imports.

BREAKING CHANGE:

Only use names exports as default exports don't play well with
CommonJS + Typescript typing.

This means that when you use ESM imports, e.g. the raw codec is
no longer imported as

```js
import raw from 'multiformats/codecs/raw'
```

but as

```js
import * as raw from 'multiformats/codecs/raw'
```

The CJS import for codecs don't change, it's still `const raw = require('multiformats/codecs/raw`.

Though other imports change, so

```js
import CID from 'multiformats/cid'
const CID = require('multiformats/cid')
```

is now

```js
import { CID } from 'multiformats/cid'
const { CID } = require ('multiformats/cid')
```
Assets 2
Loading