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

console-to-server

v1.4.0

Published

A module that hosts a local server and outputs console to website

Downloads

22

Readme

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 (array[String]): 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