npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@kikotey/kikotey-debugger-listener-server

v1.0.2

Published

Listens for new messages over TCP and broadcasts to browsers via socket.io

Downloads

4

Readme

DEBUGGER FOR REACT-NATIVE, EXPO TUNNEL, LOG VIEWER AND MORE

New Usages:

  • file reader
  • simple Log Viewer
  • React-native Log Viewer
  • Expo tunnel Debugger
  • All applications that need the console debugger
  • and more

Inspired of the work of the NarrativeScience-old TEAM log.io

kikotey-debugger by kikotey.com - debug in Real-time log monitoring in your browser and console log

License Version Node

Powered by node.js + socket.io

How does it work?

A file output logs watches log files for changes, sends new messages to the server via TCP, which broadcasts to browsers via socket.io.

Terminology

Stream loader - It's the stream of logs consumed from a << source >> (file, blob for example) to a channel and exposed via a endpoint. The stream is a logical designation for a group of messages that relate to one another. Examples include an application name, a topic name, or a backend service name.

Listener server - It's a consummer server connected to a channel stream. All data consumed from the stream is exposed to the front screen or to the browser console.

Source - The path designation for a group of messages that originate from the same source. Examples include all logs of a server, a service provider name, or a filename.

Debugger - A (loader file stream, source) pair.

While originally designed to represent backend service logs spread across multiple servers, the stream/source abstraction is intentionally open-ended to allow users to define a system topology for their specific use case.

Install & run

Install via npm

npm i -g @kikotey/kikotey-debugger-listener-server
npm i -g @kikotey/kikotey-debugger-stream-loader
npm i -g @kikotey/kikotey-debugger-cli

Configure hosts & ports (see example below)

vim ~/.kiko-cli/server.json
vim ~/.kiko-cli/config/file.json

Run server

debugger-listener-server
debugger-stream-loader

or with cli

debugger start

Browse to http://localhost:6688

Install & run

Begin sending log messages to the server via:

With CLI

(After you create all configuration files. See step 1 and step 2 in the next section)

Run debugger

debugger start

Restart debugger

debugger restart

Stop debugger

debugger stop

Without CLI

STEP 1

kikotey-debugger-listener-server

Browse to http://localhost:6688

Server configuration

There are two servers: the message server, which receives TCP messages from message inputs, and the HTTP server, which receives requests from browsers. By default, the application looks for configuration in ~/.log.io/server.json, and can be overridden with the environment variable LOGIO_SERVER_CONFIG_PATH.

Sample configuration file:

{
  "messageServer": {
    "port": 6689,
    "host": "127.0.0.1"
  },
  "httpServer": {
    "port": 6688,
    "host": "127.0.0.1"
  },
  "debug": false,
  "basicAuth": {
    "realm": "abc123xyz",
    "users": {
      "username1": "password1"
    }
  }
}

basicAuth and debug are both optional keys that can be omitted.

Server TCP interface

The file input connects to the server via TCP, and writes properly formatted strings to the socket. Custom inputs can send messages to the server using the following commands, each of which ends with a null character:

Send a log message

+msg|streamName1|sourceName1|this is log message\0

Register a new input

+input|streamName1|sourceName1\0

Remove an existing input

-input|streamName1|sourceName1\0

STEP 2

kikotey-debugger-stream-loader

Browse to http://localhost:6689

File path input configuration

Inputs are created by associating file paths with stream and source names in a configuration file. By default, the file input looks for configuration in ~/.kiko-cli/config/file.json, and can be overridden with the environment variable LOGIO_FILE_INPUT_CONFIG_PATH.

Input paths can be a file path, directory path or a glob. Additionally, watcher options can be provided for more fine-grained control over file watching mechanics and performance. See the chokidar documentation for more information.

Sample configuration file:

{
  "messageServer": {
    "host": "127.0.0.1",
    "port": 6689
  },
  "inputs": [
    {
      "source": "server1",
      "stream": "app1",
      "config": {
        "path": "log.io-demo/file-generator/app1-server1.log"
      }
    },
    {
      "source": "server2",
      "stream": "system-logs",
      "config": {
        "path": "/var/log/**/*.log",
        "watcherOptions": {
          "ignored": "*.txt",
          "depth": 99,
        }
      }
    }
  ]
}