Every export of @deckyard/mikrotik. Background is in the introduction.
jennifer
import"@deckyard/mikrotik/"as mikrotik;
A !trap or !fatal reply, a reply word that is not UTF-8, a malformed reply (an empty sentence, a reserved or overlong length prefix, a bad login challenge), a bad query word or attribute name, and a plain-TCP login without allowInsecureAuth throw a MikrotikError (kind "mikrotik"). A socket failure is net's net.NetError (kind "net"); a deadline, a router closing mid-sentence and a reply over a cap (a word over 64 MiB, a sentence over 4096 words, a reply over 262144 words or 64 MiB) are kinds "timeout", "closed" and "limit".
Deadlines: 30 s to dial, a read stalled for 30 s, a whole reply within 5 minutes, a sentence written within 30 s. A failure that leaves a reply half read or a sentence half written closes the session; later calls on it are kind "closed". A !trap or a non-UTF-8 word is thrown after the reply's !done, and the session stays usable.
as receiveReply, waiting timeoutMs (0: no limit); a "timeout" leaves the session usable
mikrotik.cancel(session, tag)
/cancel the stream
Replies of other tags read while waiting are held (up to 4096 sentences within the reply caps) for the call that reads their tag. One task at a time may call into a session.