Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

borc

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

borc

Encode and parse data in the Concise Binary Object Representation (CBOR) data format (RFC7049).

  • 2.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
87K
increased by32.63%
Maintainers
1
Weekly downloads
 
Created
Source

borc

Coverage Status Dependency Status Travis CI Circle CI

Encode and parse data in the Concise Binary Object Representation (CBOR) data format (RFC7049) as fast as possible.

About

This library is a fork of the awesome [node-cbor](standard-readme compliant ). It borrows a lot of the interface, but drops all streaming and async processing in favor of a minimal syn api and being as fast as possible.

Installation

$ npm install --save borc

Benchmarks

TODO

Example

const cbor = require('borc')
const assert = require('assert')

const encoded = cbor.encode(true) // returns <Buffer f5>
const decoded = cbor.decodeFirst(encoded)
// decoded is the unpacked object
assert.ok(obj === true)

// Use integers as keys
var m = new Map()
m.set(1, 2)
encoded = cbor.encode(m) // <Buffer a1 01 02>

API

See https://dignifiedquire.github.io/borc for details

The sync encoding and decoding are exported as a leveldb encoding, as cbor.leveldb.

Supported types

The following types are supported for encoding:

  • boolean
  • number (including -0, NaN, and ±Infinity)
  • string
  • Array, Set (encoded as Array)
  • Object (including null), Map
  • undefined
  • Buffer
  • Date,
  • RegExp
  • url.URL
  • bignumber

Decoding supports the above types, including the following CBOR tag numbers:

TagGenerated Type
0Date
1Date
2bignumber
3bignumber
4bignumber
5bignumber
32url.URL
35RegExp

License

MIT

Keywords

FAQs

Package last updated on 11 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc