node.mx raw

   1  //go:build !wasm
   2  //:build !wasm
   3  
   4  package node
   5  
   6  // Node jsbridge - stdin/stdout/stderr line-oriented IO for Node.js CLI targets.
   7  // Runtime implementation lives in moxiejs jsruntime/node.mjs.
   8  
   9  // OnLine registers a line-handler for stdin. Called per line (no trailing newline).
  10  // If stdin closes, the runtime closes any channel the handler sends to.
  11  func OnLine(fn func(string)) { panic("jsbridge") }
  12  
  13  // OnClose registers a handler called once when stdin hits EOF.
  14  func OnClose(fn func()) { panic("jsbridge") }
  15  
  16  // WriteLine writes a line to stdout (newline appended). Flushed immediately.
  17  func WriteLine(s string) { panic("jsbridge") }
  18  
  19  // WriteErr writes a line to stderr (newline appended).
  20  func WriteErr(s string) { panic("jsbridge") }
  21  
  22  // Exit terminates the process with the given code.
  23  func Exit(code int32) { panic("jsbridge") }
  24  
  25  // NowSeconds returns current time as Unix seconds (Node wall clock).
  26  func NowSeconds() (n int64) { panic("jsbridge") }
  27