request.flushHeaders()

request.flushHeaders() Flush the request headers. For efficiency reasons, Node.js normally buffers the request headers until you call request.end() or write the first chunk of request data. It then tries hard to pack the request headers and data into a single TCP packet. That's usually what you want (it saves a TCP round-trip) but not when the first data isn't sent until possibly much later. request.flushHeaders() lets you bypass the optimization and kickstart the request.

request event (http.Server)

Event: 'request' function (request, response) { } Emitted each time there is a request. Note that there may be multiple requests per connection (in the case of keep-alive connections). request is an instance of http.IncomingMessage and response is an instance of http.ServerResponse.

REPLServer

Class: REPLServer This inherits from Readline Interface with the following events:

replServer.defineCommand()

replServer.defineCommand(keyword, cmd) keyword <String> cmd <Object> | <Function> Makes a command available in the REPL. The command is invoked by typing a . followed by the keyword. The cmd is an object with the following values: help - help text to be displayed when .help is entered (Optional). action - a function to execute, potentially taking in a string argument, when the command is invoked, bound to the REPLServer instance (Required). If a function is provided

replServer.displayPrompt()

replServer.displayPrompt([preserveCursor]) preserveCursor <Boolean> Like readline.prompt except also adding indents with ellipses when inside blocks. The preserveCursor argument is passed to readline.prompt. This is used primarily with defineCommand. It's also used internally to render each prompt line.

repl.start()

repl.start([options]) Returns and starts a REPLServer instance, that inherits from Readline Interface. Accepts an "options" Object that takes the following values: prompt - the prompt and stream for all I/O. Defaults to > . input - the readable stream to listen to. Defaults to process.stdin. output - the writable stream to write readline data to. Defaults to process.stdout. terminal - pass true if the stream should be treated like a TTY, and have ANSI/VT100 escape codes written to it

removeListener event (EventEmitter)

Event: 'removeListener' eventName <String> | <Symbol> The event name listener <Function> The event handler function The 'removeListener' event is emitted after a listener is removed.

readstream.setRawMode()

rs.setRawMode(mode) mode should be true or false. This sets the properties of the tty.ReadStream to act either as a raw device or default. isRaw will be set to the resulting mode.

rejectionHandled event (Process)

Event: 'rejectionHandled' Emitted whenever a Promise was rejected and an error handler was attached to it (for example with .catch()) later than after an event loop turn. This event is emitted with the following arguments: p the promise that was previously emitted in an 'unhandledRejection' event, but which has now gained a rejection handler. There is no notion of a top level for a promise chain at which rejections can always be handled. Being inherently asynchronous in nature, a promise re

ref()

ref() If a timer was previously unref()d, then ref() can be called to explicitly request the timer hold the program open. If the timer is already refd calling ref again will have no effect. Returns the timer.