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.end()

request.end([data][, encoding][, callback]) Finishes sending the request. If any parts of the body are unsent, it will flush them to the stream. If the request is chunked, this will send the terminating '0\r\n\r\n'. If data is specified, it is equivalent to calling response.write(data, encoding) followed by request.end(callback). If callback is specified, it will be called when the request stream is finished.

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

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

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.

REPLServer

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

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.

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.

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

ReferenceError

Class: ReferenceError A subclass of Error that indicates that an attempt is being made to access a variable that is not defined. Such errors commonly indicate typos in code, or an otherwise broken program. While client code may generate and propagate these errors, in practice, only V8 will do so. doesNotExist; // throws ReferenceError, doesNotExist is not a variable in this program. ReferenceError instances will have an error.arguments property whose value is an array containing a single el