You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
475 B
JavaScript

"use strict";
const cbor = require("cbor");
const fromNodeStream = require("@promistream/from-node-stream");
module.exports = function createDecodeCBORStream(options) {
// This is suboptimal; ideally we would call the relevant decoding functions directly, instead of wrapping a Node stream. However, the cbor library does not seem to expose the necessary low-level functions to implement this.
let decoder = new cbor.Decoder(options);
return fromNodeStream(decoder);
};