JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 702193
  • Score
    100M100P100Q216894F
  • License MIT

Tiny CBOR library

Package Exports

  • @levischuck/tiny-cbor

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@levischuck/tiny-cbor) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Tiny CBOR

This minimal generic library decodes most useful CBOR structures into simple JavaScript structures:

  • Maps with keys as strings or numbers with CBORType values
  • Arrays of CBORType values
  • numbers
  • strings
  • byte strings as Uint8Array
  • booleans
  • null and undefined

This implementation does not support indefinite length maps, arrays, text strings, or byte strings. It also does not support half precision floating point numbers.

It currently does not decode numbers > 65535.

Maps only support strings or numbers as keys, while CBOR allows more than this, it is difficult to implement in lightweight JavaScript. Maps that have duplicate keys will result in an error during decoding.