cbor-object
v1.0.20
Published
CBOR: deterministic encoder/decoder, diagnostic notation encoder/decoder, and utilities
Maintainers
Readme
cbor-object
Core Description: https://github.com/cyberphone/CBOR.js#cborjs
Nodejs Installation
npm install cbor-objectIf cbor-object is to be installed as a global package, perform the following:
npm install cbor-object -g
cd "to local work directory"
npm link cbor-objectUsage in Node.js
The above works for both CJS and MJS (ESM) applications. MJS example:
// test.mjs
import CBOR from 'cbor-object';
let cbor = CBOR.Map()
.set(CBOR.Int(1), CBOR.Float(45.7))
.set(CBOR.Int(2), CBOR.String("Hi there!")).encode();
console.log(CBOR.toHex(cbor));Usage in Browsers
Copy the file https://github.com/cyberphone/CBOR.js/blob/main/src/cbor.js to your application and include it in HTML with the <script src='...'></script> tag.
Release Notes
See file https://cyberphone.github.io/CBOR.js/doc/release-notes.txt
