mter-rs
TypeScript icon, indicating that this package has built-in type declarations

1.3.2 • Public • Published

mterminal-remote-server

capture your terminal logs, and send to network by udp. you can use mter to get those logs and print.

why

Normally, your nodejs application will mix the logs of the master process and the cluster process in one terminal to print. In development mode, this can cause confusion. We need need a tool to separate these logs into different places for printing. so here you are.

usage

  1. write your code.
import { setupMter } from '../src/';
 
setupMter();
  1. install and run mter.
# install  
npm i -g mter
# start the server 
mter 
  1. start you app.
MTER="*" node your-app.js

API

setupMter(opt?:MterOptions)

MterOptions

  • keep_stdout?: boolean,
  • process_name?: string,
  • recipient_port?: number,
  • heartbeat_udp_port?: number,
  • default_bind_udp_port?: number,
  • bind_udp_port_lock_file_name?: string,

normally, you only need config: keep_stdout. if true, the log will keep print in you terminal, and broadcast at the same time.

in mter api, you can get the debugging process name by api:http://127.0.0.1:4510/api/wss. but you maybe see like this:{"list":[{"path":"/wss/4869","process_name":"MASTER-test2.ts-9885"},{"path":"/wss/4870","process_name":"CLUSTER-test2.ts-9891"}]}, you can config the process_name to change. this can improve readability.

Readme

Keywords

none

Package Sidebar

Install

npm i mter-rs

Weekly Downloads

3

Version

1.3.2

License

MIT

Unpacked Size

10.2 kB

Total Files

4

Last publish

Collaborators

  • kezhaofeng