Skip to content
Tyler Kellen edited this page Jan 30, 2014 · 20 revisions

A virtual file format

A Record is a representation of some form of input, typically a file, whose contents are stored in an underlying buffer or stream. Records are passed between Tasks, allowing unlimited in-memory transformations before being written to their final destination. A valid Record instance must include the following properties and methods. The canonical implementation is node-record.

path

A string property identifying the source of a record.

encoding

String property containing an optional default encoding for the record.

contents

A getter/setter for the underlying contents of the record.

isNull()

Return true if the record contents are null.

isBuffer()

Return true if the record contents are a Buffer.

isStream()

Return true if the record contents are a Stream.

clone()

Return a clone of the record.

pipe(stream[, opt])

  • If the record contents are a Buffer, it will be written to the provided stream.
  • If the record contents are a Stream, pipe them to the provided stream.
  • If the record contents are null, this will do nothing.
  • If opt.end is true, the destination stream will not be ended (same as node core).

Returns the provided stream.

Clone this wiki locally