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

logtrek

v0.3.0

Published

LogTrek is a modular logging library for Node.js and TypeScript, boldly going where no logs have gone before. Designed for speed, flexibility, and futuristic elegance, LogTrek provides a robust logging solution with plugin-based extensibility and customiz

Readme

LogTrek

LogTrek is a modular logging library for Node.js and TypeScript, boldly going where no logs have gone before. Designed for speed, flexibility, and futuristic elegance, LogTrek provides a robust logging solution with plugin-based extensibility and customizable log levels. Whether you're exploring new logging frontiers or managing critical system logs, LogTrek has you covered.


Features

  • Modular Design: Easily extend functionality by creating custom plugins.
  • Built-in Plugins: Supports console and file-based logging out of the box.
  • Customizable Log Levels: Fine-tune which logs are displayed or written.
  • TypeScript Support: Strongly typed for a seamless developer experience.
  • Test-First Philosophy: All features are required to have corresponding tests.

Installation

Install LogTrek via npm:

npm install logtrek

Usage

Basic Example

import { Logger } from 'logtrek';

const logger = new Logger('info', 'console');

logger.info('This is an informational message');
logger.warn('This is a warning');
logger.error('This is an error message');

File-Based Logging

const logger = new Logger('warn', 'file', { location: '/var/log/app.log' });

logger.warn('Warning: Disk space is low');
logger.error('Error: Disk write failed');

Custom Log Levels

const logger = new Logger('debug', 'console');

logger.debug('Debugging information');
logger.info('Operational message');
logger.error('Critical error occurred');

Development

Getting Started

  1. Clone the repository:

    git clone https://github.com/yourusername/logtrek.git
    cd logtrek
  2. Install dependencies:

    npm install
  3. Build the project:

    npm run build
  4. Run tests:

    npm test

Project Structure

logtrek/
├── src/               # Source code
│   ├── logger.ts      # Core Logger implementation
│   ├── pluginLoader.ts # Plugin loader
│   ├── plugins/       # Built-in plugins (console, file)
├── tests/             # Test cases
│   ├── unit/          # Unit tests
│   ├── integration/   # Integration tests
├── dist/              # Compiled output
├── README.md          # Project documentation
├── package.json       # Project metadata
└── tsconfig.json      # TypeScript configuration

Creating a New Plugin

Plugins allow you to extend LogTrek's functionality. Follow these steps to create a custom plugin:

1. Define Your Plugin

Create a new file in the src/plugins/ directory:

import { LoggerPlugin, LogLevel } from '../types';

const customPlugin: LoggerPlugin = {
    pluginType: 'custom',
    configure: (options: Record<string, any>) => {
        console.log('Custom plugin configured with options:', options);
    },
    write: (level: LogLevel, message: string, meta?: Record<string, any>) => {
        console.log(`[${level.toUpperCase()}]: ${message}`, meta);
    },
};

export default customPlugin;

2. Use the Plugin

const logger = new Logger('info', 'custom');
logger.info('Using the custom plugin!');

Writing Tests

All features must have corresponding tests. This is a core philosophy of LogTrek to ensure reliability and maintainability.

Running Tests

npm test

Writing Unit Tests

Place your unit tests in the tests/unit/ directory. Example:

import { Logger } from '../../src/logger';

describe('Logger', () => {
    it('should log messages at the correct level', () => {
        const logger = new Logger('info', 'console');
        logger.info('This is a test');
    });
});

Writing Integration Tests

Place integration tests in the tests/integration/ directory. Example:

import { Logger } from '../../src/logger';

describe('Integration Test', () => {
    it('should log to the console and file', () => {
        const logger = new Logger('warn', 'file', { location: 'test.log' });
        logger.warn('Integration test message');
    });
});

Contributing

Guidelines

  1. Test Coverage: Every new feature must have corresponding tests. No feature is complete without tests.
  2. Code Style: Follow the existing code style and conventions.
  3. Pull Requests: Include a description of your changes and why they are necessary.

Development Workflow

  1. Create a new branch:
    git checkout -b feature/my-new-feature
  2. Make your changes and write tests.
  3. Run tests to ensure everything works:
    npm test
  4. Commit your changes:
    git commit -m "Add my new feature"
  5. Push your branch:
    git push origin feature/my-new-feature
  6. Open a pull request on GitHub.

License

LogTrek is licensed under the MIT License.