Skip to content

looshi/looshis-local-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

looshis-local-logger

NPM Version NPM Downloads

Stream terminal output to the browser devtools!

browser next to terminal

LLL is a command line program which allows you to view terminal output in a browser's devtools. Use the JSON inspector, filter, and more when viewing your terminal's output.

LLL has no dependencies.

Install

npm i -g looshis-local-logger

How To Use

Start an application from LLL:

lll "node ./examples/node-app/index.js"

OR start LLL in standalone mode:

lll
# LLL> Enter Commands

After LLL has started, open your browser and navigate to http://localhost:3333, open devtools and click on the console tab.

CTRL+C to exit.

More Examples

# Start lll in standalone mode and enter a curl command
lll
curl -s https://swapi.dev/api/planets/1 \
  -H "Accept: application/json"

# Run npm script:
lll "npm --prefix ./examples/node-app run start"
# Open browser at http://localhost:3333, open devtools.

# Specify a port:
LLL_PORT=1234 lll "npm --prefix ./examples/node-app run start"
 # Open browser at: http://localhost:1234/, open devtools.

# Start a ruby app:
lll "ruby ./examples/ruby-app/ruby.rb"
# Open browser at http://localhost:3333, open devtools.

# Pass env vars to the child process:
MY_VAR=3 lll "node ./examples/node-app/index"
# MY_VAR will be available in node-app.index.js

How it works

LLL is a lightweight node application that essentially captures stdout and serves it down to an html client. LLL works slightly different depending on whether you pass it args ( spawn ) or not ( standalone ).

When given a command, LLL will spawn the given command in a subprocess. The subprocess stdout/stderr events are then sent to a browser-based client via server-sent events.

If no command is given, the server listens for stdin, runs that command, and sends its sdtout/stderr to the client via server-sent events.

About

View terminal output in the browser!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published