IOLib
The :io-lib it.unibo.tuprolog.solve.library.Library, contributing the ISO Prolog stream/I/O predicates: stream management (open/3,4, close/1,2, current_input/1, current_output/1, set_input/1, set_output/1, stream_property/2, at_end_of_stream/0,1, flush_output/1), character/code-level reading and writing (get_char/1,2, get_code/1,2, peek_char/1,2, peek_code/1,2, put_char/1,2, put_code/1,2, nl/1), term I/O (read/1,2, read_term/2,3, write/2, writeq/1,2, write_canonical/1,2, write_term/2,3), plus the tuProlog-specific consult/1 and set_theory/1 for loading a theory from a it.unibo.tuprolog.solve.libs.io.Url.
Every predicate is implemented against it.unibo.tuprolog.solve.channel.Channel (see it.unibo.tuprolog.solve.channel.InputChannel and it.unibo.tuprolog.solve.channel.OutputChannel), so the same predicate set works uniformly whether a stream backs a JVM File, an in-memory string, or (on JS) a fetched URL. Byte-oriented predicates (get_byte/1,2, put_byte/1,2, peek_byte/1,2) and the character-conversion table (char_conversion/2, current_char_conversion/2) are registered, per ISO, but are not actually supported by this implementation: invoking them always raises a it.unibo.tuprolog.solve.exception.error.SystemError.
Load it into a it.unibo.tuprolog.solve.library.Runtime alongside other libraries, e.g. Runtime.of(IOLib, OOPLib), as done by the :repl and :ide modules.