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 🙏

© 2026 – Pkg Stats / Ryan Hefner

fimidx-log-files-consumer

v0.0.1

Published

Consumes log files from the file system and sends them to the Fimidx server

Readme

Fimidx Log Files Consumer

A Node.js application that monitors log files and sends their contents to a Fimidx server for processing and analysis.

Features

  • Real-time monitoring: Uses chokidar to watch log files for changes
  • Configurable: JSON configuration file with per-file and global settings
  • Efficient processing: Only processes new content since last consumption
  • Resilient: Handles file rotation, missing files, and network issues
  • State persistence: Tracks consumption progress to avoid reprocessing

Installation

npm install
npm run compile

Usage

Command Line

node build/index.js <config-filepath>

Programmatic

import {startLogFilesConsumer} from './build/index.js';

const consumer = await startLogFilesConsumer('./config.json');

// Stop the consumer when done
await consumer.stop();

Configuration

The configuration file is a JSON file with the following structure:

{
  "appId": "your-app-id",
  "clientToken": "your-client-token",
  "serverURL": "https://your-fimidx-server.com",
  "metadata": {
    "environment": "production",
    "service": "log-consumer"
  },
  "logFiles": [
    {
      "path": "/var/log/application.log",
      "metadata": {
        "logType": "application",
        "level": "info"
      }
    }
  ],
  "trackConsumptionFilepath": "./consumption-data.json"
}

Configuration Options

Global Options (optional, can be overridden per file)

  • appId (string): Your Fimidx application ID
  • clientToken (string): Your Fimidx client token
  • serverURL (string): Fimidx server URL
  • metadata (object): Global metadata to attach to all log entries

Per-File Options

  • path (string, required): Path to the log file to monitor
  • metadata (object, optional): File-specific metadata
  • appId (string, optional): Override global appId
  • clientToken (string, optional): Override global clientToken
  • serverURL (string, optional): Override global serverURL

Required Options

  • trackConsumptionFilepath (string): Path to save consumption progress

How It Works

  1. Initialization: Loads configuration and starts watching the config file
  2. File Monitoring: Watches all configured log files for changes
  3. Consumption Loop: Runs every 10 seconds to process awake files
  4. State Management:
    • Files with new content are in "awake" state
    • Files without changes are moved to "asleep" state
    • When asleep files change, they're moved back to awake state
  5. Progress Tracking: Saves consumption progress to avoid reprocessing

File States

  • Awake Files: Files that have new content to process
  • Asleep Files: Files that haven't changed recently (watched for changes)

Error Handling

  • Missing files are logged as warnings and skipped
  • Network errors are logged but don't stop processing
  • Invalid configurations throw errors and stop the application
  • File access errors are logged but processing continues

Development

# Compile TypeScript
npm run compile

# Run tests
npm test

# Lint code
npm run lint

Example

See example-config.json for a complete configuration example.