{ } qjs-modules

io

Source: lib/io.js (pure JS) — default export: io

File-descriptor read/write handler registration and multiplexing (an event-loop I/O dispatcher).

Exports

ExportArgsKindDescription
setHandler(fd, m, callback)3functionRegisters a read/write (m = READ/WRITE) handler for fd.
setReadHandler(fd, callback)2functionRegisters a read handler (or clears it with null).
setWriteHandler(fd, callback)2functionRegisters a write handler (or clears it with null).
checkFileDescriptor(fd)1functionValidates a descriptor.
Multiplexer—classDispatches registered handlers as descriptors become ready.
DescriptorMap—classArray subtype mapping fds → handler entries.
HandlerEntry—classArray subtype holding the handlers for one fd.
IOReadDecorator, IOWriteDecorator—constMixins adding read/write helpers to streams.
READ, WRITE—constHandler-direction constants (0 / 1).
io—objectThe default I/O dispatcher. (default export)

Export list

Generated by utilities/doc-api.js from the io dump of utilities/api-surface.sh: 38 members. Edit the text above this block, not the block.

Functions: checkFileDescriptor(), setHandler(), setReadHandler(), setWriteHandler()

Values: default, READ = 0, WRITE = 1

DescriptorMap

class, constructible

  • methods: delete(), get(), keys(), set()
  • properties: [Symbol.toStringTag]

HandlerEntry

class, constructible

  • static methods: isHandlers()
  • properties: active (get), [Symbol.toStringTag]

IOReadDecorator

object

  • static methods: getByte(), getline(), readAsString(), tell()

IOWriteDecorator

object

  • static methods: printf(), putByte(), puts()

Multiplexer

class, constructible

  • static values: instance
  • methods: check(), close(), fds(), getHandler(), on(), once()
  • properties: [Symbol.toStringTag]