# dag-cbor-sync

> Synchronous serialize/deserialize for IPLD dag-cbor.

Latest version **0.6.3** (published 2020-02-11) · Apache-2.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install dag-cbor-sync
pnpm add dag-cbor-sync
yarn add dag-cbor-sync
bun add dag-cbor-sync
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.6.3 |
| Published | 2020-02-11 |
| First published | 2018-06-30 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Mikeal Rogers |
| Maintainers | mikeal |

## Links

- npm: https://www.npmjs.com/package/dag-cbor-sync
- Repository: https://github.com/mikeal/dag-cbor-sync
- Homepage: https://github.com/mikeal/dag-cbor-sync#readme
- Issues: https://github.com/mikeal/dag-cbor-sync/issues
- npm.io page: https://npm.io/package/dag-cbor-sync

## Dependencies (5)

- [borc](https://npm.io/package/borc.md) ^2.0.3
- [cids](https://npm.io/package/cids.md) ^0.7.1
- [ipfs-block](https://npm.io/package/ipfs-block.md) ^0.8.0
- [is-circular](https://npm.io/package/is-circular.md) ^1.0.1
- [multihashing-async](https://npm.io/package/multihashing-async.md) ^0.8.0

## Recent versions

- 0.6.3 (latest) — 2020-02-11
- 0.6.2 — 2019-11-25
- 0.6.0 — 2018-11-07
- 0.5.0 — 2018-11-07
- 0.4.0 — 2018-11-07
- 0.2.0 — 2018-07-03
- 0.1.0 — 2018-06-30

## README

# Synchronous seralization/deserialization for dag-cbor nodes

Usage:

```javascript
let cbor = require('dag-cbor-sync')()
let buffer = cbor.serialize({test: 1234})
let obj = cbor.deserialize(buffer)
```

With links

```javascript
let buffer = cbor.serialize(
  /* Object with single '/' property of a base encoded CID represents
     a link
  */
  {test: {'/': 'zdpuAkv7jA671owT26AnJiFXG9usHmCAW6MTzpwFJw46X1PLG'}}
)
let obj = cbor.deserialize(buffer)
Buffer.isBuffer(obj.test['/']) // true
```

## require('dag-cbor-sync')([maxsize])

Optionally set the maximum size of the cbor node. Node's larger
will throw an exception.

## serialize(object)

Returns a buffer of the binary representation of the object.

## deserialize(buffer)

Returns the native representation.

Note the link CID's will already be converted to buffers.

---
_Source: https://npm.io/package/dag-cbor-sync · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
