Stream JavaScript directives

js_preread (stream-js)

Selects a handler for the stream preread phase.

Formal Syntax & Structure

nginx syntaxnginx
js_preread module.function;

Parameters & Attributes

NameTypeDescription
handlermodule.functionInitialize at stream preread; register data callbacks as appropriate. Direct handler is synchronous; supported async callbacks in s.on differ by phase.

Working Example

Example Snippetnginx
js_preread session.inspect;
Nginx Reference