Diagnose

Diagnose

Output the diagnostic format from a stream of CBOR bytes.

Constructor

new Diagnose(optionsopt)

Creates an instance of Diagnose.
Source:
Parameters:
Name Type Attributes Default Description
options Object <optional>
{} options for creation
Name Type Attributes Default Description
separator string <optional>
'\n' output between detected objects
stream_errors bool <optional>
false put error info into the output stream
max_depth number <optional>
-1 -1 for "until you run out of memory". Set this to a finite positive number for un-trusted inputs. Most standard inputs won't nest more than 100 or so levels; I've tested into the millions before running out of memory.

Extends

  • stream.Transform

Methods

(static) diagnose(input, encodingopt, cb) → {Promise}

Convenience function to return a string in diagnostic format.
Source:
Parameters:
Name Type Attributes Default Description
input Buffer | string the CBOR bytes to format
encoding string <optional>
'hex' the encoding of input, ignored if input is Buffer
cb commentCallback callback
Returns:
Type:
Promise
if callback not specified