min-stream-pkt-line

A pkt-line codec packaged as a min-stream push-filter.

min-stream-pkt-line

A pkt-line codec packaged as maps and min-stream push-filters.

This is a component of the js-git project.

This module exports 4 functions. There are two maps and two push-filters.

var pktLine = require('min-stream-pkt-line');
 
// Assuming source, app, and sink already exist, here is one way to insert the 
// framing and deframing into the stream. 
helpers.run([
  source,
    pktLine.deframer,
     app,
    pktLine.framer,
  sink
]);

The map functions are used directly as needed and not applied to the stream as a whole.

A map function that encodes the data portion of pkt-lines

A map function that decodes the data portion of pkt-lines.

A push-filter that consumes arbitrary sized buffers and outputs deframed message buffers.

The flush message is encoded as null

If the stream transitions to raw PACK mode, a true event is emitted to signify the transition.

A map function that accepts a buffer and returns a framed buffer.

Pass in null to encode a flush frame.

Pass in true to set the mode to raw PACK mode.