Definitions

~ShiftBufferCallback : function

Shift Function

Kind: inner typedef

Param Type Description
shifted Buffer | any shifted bytes

~BufferParseCallback : Promise.<any> | any

Kind: inner typedef
Returns: Promise.<any> | any - the promise should be resolved with the parsed object

Param Type Description
chunk Buffer the transformed chunk

~MapCallback : Promise.<any> | any

Kind: inner typedef
Returns: Promise.<any> | any - the mapped object

Param Type Description
chunk any the chunk to be mapped

~FilterCallback : Promise.<Boolean> | Boolean

Kind: inner typedef
Returns: Promise.<Boolean> | Boolean - information if the object should remain in the filtered stream.

Param Type Description
chunk any the chunk to be filtered or not

~ReduceCallback : Promise.<any> | any

Kind: inner typedef
Returns: Promise.<any> | any - accumulator for the next pass

Param Type Description
accumulator any the accumulator - the object initially passed or returned by the previous reduce operation
chunk object the stream chunk.

~DoCallback : Promise.<any> | any ⇄

Kind: inner typedef
Returns: Promise.<any> | any - the outcome is discarded

Param Type Description
chunk object source stream chunk

~IntoCallback : Promise.<any> | any ⇄

Kind: inner typedef
Returns: Promise.<any> | any - resolution for the old stream (for flow control only)

Param Type Description
into * stream passed to the into method
chunk any source stream chunk

~UseCallback : DataStream ⇄

Kind: inner typedef

Param Type
stream DataStream
...parameters Array.<any>

~TeeCallback : function

Kind: inner typedef

Param Type Description
teed DataStream The teed stream

~ScramjetTransformCallback : Promise.<(any|undefined)> | any | undefined

Transform async callback. The passed transform should return a new chunk, unless the output should be filtered - if so, the transform should return undefined.

Additionally the function can reject with DataStream.filter - the result will be filtered and no other transforms will be run on the chunk.

Kind: inner typedef
Returns: Promise.<(any|undefined)> | any | undefined - the result, undefined will be treated as filtered out.

Param Type Description
chunk Buffer | string | any the stream chunk
encoding string encoding of the chunk

~ScramjetWriteCallback : Promise.<void> | void

Write async callback. Await your async write and resolve.

Kind: inner typedef
Returns: Promise.<void> | void - should resolve when the write ends

Param Type Description
chunk Buffer | string | any the stream chunk
encoding string encoding of the chunk

~ScramjetReadCallback : Array.<any> | Promise.<Array.<any>>

Read async callback. Simply await your async operations and return the result as array.

Kind: inner typedef
Returns: Array.<any> | Promise.<Array.<any>> - the read chunk.

Param Type Description
count number the number of chunks that should be read ("this is more like a set of guideline than actual rules").

~DataStreamOptions : object

Standard options for scramjet streams.

Defines async transforms or read/write methods for a stream.

Kind: inner typedef
Properties

Name Type Default Description
[promiseRead] ScramjetReadCallback an async function returning the next read item
[promiseWrite] ScramjetWriteCallback an async function writing the next written item
[promiseTransform] ScramjetTransformCallback an async function returning a transformed chunk
[promiseFlush] ScramjetReadCallback an async function run before transform stream ends to push last chunks from the buffer
[beforeTransform] ScramjetTransformCallback an async function run before the transform
[afterTransform] ScramjetTransformCallback an async function run after the transform
[maxParallel] number os.cpus.length*2 the number of transforms done in parallel
[referrer] DataStream a referring stream to point to (if possible the transforms will be pushed to it
[objectMode] boolean true should the object mode be used instead of creating a new stream)
[highWaterMark] number The maximum number of bytes to store in the internal buffer before ceasing to read from the underlying resource. Default: 16384 (16KB), or 16 for objectMode streams.
[encoding] string If specified, then buffers will be decoded to strings using the specified encoding. Default: null.
[emitClose] boolean Whether or not the stream should emit 'close' after it has been destroyed. Default: true.
[read] function Implementation for the stream._read() method.
[destroy] function Implementation for the stream._destroy() method.
[construct] function Implementation for the stream._construct() method.
[autoDestroy] boolean Whether this stream should automatically call .destroy() on itself after ending. Default: true.

~ShiftCallback : function

Shift Function

Kind: inner typedef

Param Type Description
shifted Array.<object> | any an array of shifted chunks

~AccumulateCallback : Promise.<any> | *

Kind: inner typedef
Returns: Promise.<any> | * - resolved when all operations are completed

Param Type Description
accumulator * Accumulator passed to accumulate function
chunk * the stream chunk

~ConsumeCallback : Promise.<any> | *

Kind: inner typedef
Returns: Promise.<any> | * - resolved when all operations are completed

Param Type Description
chunk * the stream chunk

~RemapCallback : Promise.<any> | *

Kind: inner typedef
Returns: Promise.<any> | * - promise to be resolved when chunk has been processed

Param Type Description
emit function a method to emit objects in the remapped stream
chunk * the chunk from the original stream

~FlatMapCallback : AsyncGenerator.<any, void, any> | Promise.<Iterable.<any>> | Iterable.<any>

Kind: inner typedef
Returns: AsyncGenerator.<any, void, any> | Promise.<Iterable.<any>> | Iterable.<any> - promise to be resolved when chunk has been processed

Param Type Description
chunk * the chunk from the original stream

~JoinCallback : Promise.<_> | _

Kind: inner typedef
Returns: Promise.<*> | * - promise that is resolved with the joining item

Param Type Description
previous * the chunk before
next * the chunk after

~AffinityCallback : Symbol | string

Kind: inner typedef

Param Type
chunk *

~DelegateCallback : function

Kind: inner typedef

~RateOptions : object

Kind: inner typedef

Param Type Default Description
[timeFrame] number 1000 The size of the window to look for streams.
[getTime] function Date.now Time source - anything that returns time.
[setTimeout] function setTimeout Timing function that works identically to setTimeout.

~ExecDataOptions : object

Kind: inner typedef
Extends: StringStream.ExecOptions
Properties

Name Type Description
[parse] UseCallback scramjet module to transform the stream to string or buffer stream
[stringify] UseCallback scramjet module to transform from string or buffer stream to wanted version

~CreateModuleOptions : object

Options for createModule

Kind: inner typedef
Properties

Name Type Description
StreamClass DataStream defines what class should the module assume

~StreamMixin : object

Definition of a single mixin for a specific Scramjet class. Should contain any number of stream methods.

Kind: inner typedef
Properties

Name Type Description
constructor function optional constructor that will be called in the stream constructor (this has to be an own property!)

~ScramjetPlugin : object

Definition of a plugin in Scramjet

Kind: inner typedef
Internal:
Properties

Name Type Description
BufferStream StreamMixin definition of constructor and properties for the BufferStream prototype.
DataStream StreamMixin definition of constructor and properties for the DataStream prototype.
MultiStream StreamMixin definition of constructor and properties for the MultiStream prototype.
StringStream StreamMixin definition of constructor and properties for the StringStream prototype.

~MultiMapCallback : DataStream ⇄

Kind: inner typedef

Param Type
stream DataStream

~DistributeOptions : object

Distribute options

Kind: inner typedef
Properties

Name Type Default Description
[plugins] Array [] a list of scramjet plugins to load (if omitted, will use just the ones in scramjet itself)
[StreamClass] string "DataStream" the class to deserialize the stream to.
[threads] number os.cpus().length * 2 maximum threads to use - defaults to number of processor threads in os, but it may be sensible to go over this value if you'd intend to run synchronous code.
[createOptions] DataStreamOptions {} maximum threads to use - defaults to number of processor threads in os, but it may be sensible to go over this value if you'd intend to run synchronous code.
[StreamWorker] StreamWorker scramjet.StreamWorker worker implementation.

~ValueOfCallback : Promise.<number> | number

Kind: inner typedef
Returns: Promise.<number> | number - value of the object

Param Type Description
chunk * stream object

~NumberStreamOptions : object

NumberStream options

Kind: inner typedef
Extends: DataStreamOptions
Properties

Name Type Default Description
[valueOf] ValueOfCallback x => +x value of the data item function.

~ShiftStringCallback : function

Kind: inner typedef

Param Type Description
shifted string | any Shifted chars

~ParseCallback : Promise.<any> | any

Kind: inner typedef
Returns: Promise.<any> | any - the promise should be resolved with the parsed object

Param Type Description
chunk string the transformed chunk

~ExecOptions : object

Kind: inner typedef
Extends: child_process.SpawnOptions
Properties

Name Type Default Description
[stream] number 1 (bitwise) the output stdio number to push out (defaults to stdout = 1)
[interpreter] Array.<string> [] defaults to nothing, except on windows where "cmd.exe /c" will be spawned by default