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

new-log

v1.1.11

Published

[![npm](https://img.shields.io/npm/v/new-log?label=version&logo=npm)](https://www.npmjs.com/package/new-log) [![npm bundle size](https://img.shields.io/bundlephobia/min/new-log?logo=npm)](https://bundlephobia.com/result?p=new-log)

Downloads

23

Readme

NotEnoughWood - NEW

npm npm bundle size

NotEnoughWood - A simple way to access your logs via http/s.
Show the results of commands in the web. No need for a ssh session to check the log files.

Features

  • Access the logs of commands, like docker logs <container-name>.
  • If the logs are written to disk, you can host these logfiles.
  • Use cURL to access the service, or add the plain query to the url to show the result without html. Like http://localhost:4200/test.log?plain=true
  • Use the query param tail you can specify the lines (from the ending) you want to see. Something Like http://localhost:4200/test.log?tail=10 means seeing the last 10 lines of the command output.
███╗░░██╗███████╗░██╗░░░░░░░██╗
████╗░██║██╔════╝░██║░░██╗░░██║
██╔██╗██║█████╗░░░╚██╗████╗██╔╝
██║╚████║██╔══╝░░░░████╔═████║░
██║░╚███║███████╗░░╚██╔╝░╚██╔╝░
╚═╝░░╚══╝╚══════╝░░░╚═╝░░░╚═╝░░
NotEnoughWood <version>
Created by open-schnick

--------------------------------------
Logfile: whoami.log
Source: (Executing) whoami
Next update in 9 seconds
--------------------------------------

open-schnick

Install

Just install new-log globally

npm install -g new-log

Usage

# new-log --help
███╗░░██╗███████╗░██╗░░░░░░░██╗
████╗░██║██╔════╝░██║░░██╗░░██║
██╔██╗██║█████╗░░░╚██╗████╗██╔╝
██║╚████║██╔══╝░░░░████╔═████║░
██║░╚███║███████╗░░╚██╔╝░╚██╔╝░
╚═╝░░╚══╝╚══════╝░░░╚═╝░░░╚═╝░░

Usage
  $ new-log <input>

Necessary arguments:
  --config, -c  specify the config path

Options
  --port, -p    specify the port.
  --folder, -f  specify the folder containing the logs. (By default the current working directory)
  --silent, -s  turn of own log messages to stout.
  --debug, -d   turn on debug log messages.

Examples
  $ new-log --port 3000 --config ./config.json --silent

--config

The core work to do to run new is to create a config file The config file contains various key to configure the service. You can find a dummy config file in the repository or below.

{
  "virtualFolderName": "Not enough wood!",
  "defaultCachingTime": 10,
  "defaultTailLines": 100,
  "faviconPath": "https://www.gnu.org/graphics/heckert_gnu.transp.small.png",
  "authentication": {
    "enabled": true,
    "username": "user",
    "password": "1234"
  },
  "logs": [
    {
      "name": "test",
      "cachingTime": 3600,
      "source": {
        "type": "command",
        "resource": "npm -v"
      }
    },
    {
      "name": "static file",
      "source": {
        "type": "file",
        "resource": "<absolute-path-to-file-here>"
      }
    },
    {
      "name": "caching disabled",
      "cachingEnabled": false,
      "source": {
        "type": "command",
        "resource": "whoami"
      }
    },
    {
      "name": "log is tailed to 20 lines",
      "tailLines": 20,
      "source": {
        "type": "command",
        "resource": "journalctl"
      }
    },
    {
      "name": "log is tailed to default 100 lines",
      "source": {
        "type": "command",
        "resource": "journalctl"
      }
    }
  ]
}
  • virtualFolderName - the name of the folder containing the logs. (This will appear in the web interface)
  • defaultCachingTime - the default time in seconds to cache log results. (any number)
  • faviconPath - sets the favicon of NEW to the result of an valid url. (valid url)
  • defaultTailLines - the default amount of lines tailed when the log size is too big. (200k bytes) (any number)
  • authentication - require authentication to access the log files.
    • enabled - set to true to require authentication.
    • username & password - credentials to log in.
  • logs - log objects need name and command keys, other keys shown are optional. All keys:
    • name - name of the log / log file (any string)
    • tailLines (optional) - amount of lines to tail for if the source returned too much. (200k bytes) (any number)
    • cachingTime (optional) - custom caching time for the log. Also in seconds (any number)
    • cachingEnabled (optional) - en/disble caching for the log. (any boolean)
    • source - a JSON object representing the info about the source of the logs
      • type - a string specifing the type of the log. Avaiable options are file and command.
      • resource - depending on the type above either the command to execute in the shell, or the absolute path to a static file. (any string)

--port

Specify a custom port for the web interface. Defaults to port 4200.

--folder

Specify a different directory for the logs (this will contain the folder with the name specified by the virtualFolderName key.

--silent

Use the --silent / -s flag to disable logging of own logs to stout.

--debug

When provided NEW does log additional info to stout

--help

Show a little help message.