PrePAN

Sign in to PrePAN

Profile

User's Modules

JSON::Delimited Provide stream and codec agnostic delimited JSON routines

Provides a handful of different Delimited JSON methods operating on buffers:

  • JSONL (Newline delimited JSON)
  • JSONSeq (JSON Sequence)
  • PrefixedJSON (JSON with length prefixed)

Stream and codec agnostic

Handles the buffer manipulation to extract one or more JSON strings. Does not perform the JSON decoding itself, rather it utilises the modules specified by the user.

  • Users choice of JSON encoder/decoder
  • Users choice of data stream reading and writing.

Raw JSON or decoded data API

Either the JSON strings or the decoded objects can be extracted

Use cases

Intended to be used outside of HTTP/RPC (which also delimits JSON) in such use places as:

  • File storage
  • Pipe and socket IPC
  • Instead of a streaming decoder/encoder

Proposed Delimiting API (object to JSON string)

  • delimitMessage
  • delimitMessages
  • delimitMessagesTo
  • encodeMessage
  • encodeMessages
  • encodeMessagesTo

Proposed Extraction/Decoding API (JSON string to object)

  • extractNextMessage
  • extractMessages
  • extractMessagesTo
  • decodeNextMessage
  • decodeMessages
  • decodeMessagesTo

drclaw1394@github 0 comments