Files
terminal-lab/wetty/docs/README.md
2026-03-03 16:07:18 +08:00

905 B

Docs

WeTTY

API

For WeTTY options and event details please refer to the api docs

Getting started

WeTTY is event driven. To Spawn a new server call wetty.start() with no arguments.

import { start } from 'wetty';

start(/* server settings, see Options */)
  .then((wetty) => {
    console.log('server running');
    wetty
      .on('exit', ({ code, msg }) => {
        console.log(`Exit with code: ${code} ${msg}`);
      })
      .on('spawn', (msg) => console.log(msg));
    /* code you want to execute */
  })
  .catch((err) => {
    console.error(err);
  });