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

everlog

v1.0.11

Published

CSV Streamed Logger for any case

Downloads

2,621

Readme

Everlog


📔 High-performance fs logging with buffering, file retention, thread safety, CSV streams and log viewer for every day usage.

With CSV Streams (channels, tables) you make your logs structurable.

CLI

$ npm i -g everlog

# Help
$ everlog

# List all created channels
$ everlog list

# Get statistic for a channel: amount of lines, files, etc.
$ everlog stats foo

# Read N last lines from a channel. Supports params `offset` and `limit`
$ everlog read foo

# Start viewer web-app.
$ everlog server --port=5772

API ↗

  1. Initialize the Everlog
import { Everlog } from 'everlog'

await Everlog.initialize({
    directory: `./logs/`,
    slack: {
        token: '',
        channelId: ''
    }
});
  1. Create Log Streams
const channel = Everlog.createChannel('foo', {
    // Keep only last N files
    fileCountMax: 20,
    // Limit size for a file. When reached, next file is created
    fileBytesMax: 500 * 1024;
    // Limit message count for a file. When reached, next file is created
    fileMessagesMax: 10 ** 7

    // Buffer N messages
    messageBufferMax: 50;
    columns: [] as ICsvColumn[];

    // Flush logs, when no activity was for N milliseconds
    writeTimeout: null as number;

    columns: [
        { name: 'Title', filterable: true },
        { name: 'MyVal', type: 'number', sortable: true, groupable: true },
        { name: 'Timestamp', type: 'date', sortable: true, groupable: true },
    ]
});

channel.writeRow([`Lorem ipsum`, 123, new Date()]);

// On the application end flush the data (in case there is smth in the buffer)
Everlog.flush();

Dev

Core (/src/)

  • Collects events from a server or from custom streams, and proceeds with persistence or further propagation (slack)
  • Creates a subapp to view collected events

Viewer (/www/)

SubApplication to view/sort/filter collected events

  • Development endpoints (unbuild source):
    • web: http://localhost:5771/index.dev.html
    • api, e.g: http://localhost:5771/api/logs/channels

Prepair

> npm i
> cd www/
> npm i

Start Example(Dev Project for the viewer)

# builds core to be available for example as lib
> npm run watch

# starts demo server with Core and Viewer attached
> npm run example

# navigate to http://localhost:5771/atma/monit/index.dev.html

🏁


©️ MIT License.