1.4.0 • Published 2 years ago

console-to-server v1.4.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

ConsoleServer Logo

ConsoleServer

A module that hosts a local server and outputs console to website Useful for people who...

  • Want to view console output on another devide (linux machine, mobile phone, etc.)
  • Want to share console with other people
  • Send simple strings to an HTML document

Usage

const { ConsoleServer } = require('./ConsoleCommand.js')

ConsoleServer.init()

const { print, print_debug, print_error, print_warn } = require('./ConsoleCommand.js') // comepletely optional, console.log just sucks bawlls

print("Text!")
print_debug("Debug!")
print_error("Error!")
print_warn("Warning!")

const { ConsoleCommand } = require('./ConsoleCommand.js')

new ConsoleCommand("name", "this is a description", ["none"], function (args) {
    print("this is my custom command!")
})

Configuration

ConsoleServer.init({
  print_link: false,
  server: {
    port: 8000
  },
  html: {
    styles: [
      ".timestamp { color: #4f4f4f; font-weight: normal }",
      "body { background: #000000 }",
      ".console_line { font-family: FreeMono, monospace }",
      ".warn { color: #ffe737 }",
      ".error { color: #e03c28; font-weight: bold; }",
      ".debug { color: #7b7b7b; font-style: italic }",
    ],
    show_timestamps: true
  },
  console: {
    default_commands: true
  }
})
  • print_link (bool): If true, prints the url of the console server (if not defined, then it won't print url)
  • server:
    • host (string): Changes the host of the server (If not defined, is internal IP by default)
    • port (string): Changes the port of server (If not defined, is '8000' by default)
    • path (string): Changes the path of the console localhost:8000*/path_here* (if not defined, is '/console' by default)
  • console:
    • prefix (string): Sets the prefix to be entered before every command $ ping (If not defined, then there is no prefix)
    • default_commands (bool): If false, disables all default commands ping, help, testargs (If not defined, then default_commands are enabled)
  • html:
    • styles (arrayString): An array of css rules to alter the look of the website hosted on server
      • timestamp (class): This is a class for all timestamps opacity: 0.5;
      • console_line (class): This is a class that every console_line has .console_line { color: white }
      • warn (class): This is a class that all the console.warn lines have .warn { color: #ffe737 }
      • error (class): This is a class that all the console.error lines have .error { color: #e03c28; font-weight: bold; }
      • debug (class): This is a class that all the console.debug lines have .debug { color: #7b7b7b; font-style: italic }
    • format_ansi (bool): Converts ANSI formatting to HTML for chalk users (If not defined, is false)
    • show_timestamps (bool): Toggles timestamp on console lines (If not defined, then false)

Screenshots

Working on a mobile browser!

ConsoleServer in a console ConsoleServer on mobile

1.4.0

2 years ago

1.3.91

3 years ago

1.3.9

3 years ago

1.3.7

3 years ago

1.3.6

3 years ago

1.3.5

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.2.3

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.3.82

3 years ago

1.3.83

3 years ago

1.3.81

3 years ago

1.3.8

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago