Class: Encoder
| Defined in: | src/encoder.coffee |
| Inherits: | stream.Transform |
Overview
Transform JavaScript values into CBOR bytes. The Writable side of
the stream is in object mode.
Class Method Summary
- . (void) encode(objs...) Encode one or more JavaScript objects, and return a Buffer containing the CBOR bytes.
Instance Method Summary
- # (function(Encoder)) addSemanticType(type, fun) Add an encoding function to the list of supported semantic types.
Class Method Details
.
(void)
encode(objs...)
Encode one or more JavaScript objects, and return a Buffer containing the CBOR bytes.
Constructor Details
#
(void)
constructor(options = {})
Create an encoder
Instance Method Details
#
(function(Encoder))
addSemanticType(type, fun)
Add an encoding function to the list of supported semantic types. This is useful for objects for which you can't add an encodeCBOR method