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 🙏

© 2025 – Pkg Stats / Ryan Hefner

gutter-logger

v1.0.0

Published

A versatile logging module for TypeScript projects.

Readme

Gutter

Gutter is a versatile logging module for TypeScript projects that allows you to log data to a remote log drain API while seamlessly integrating with the console. It provides a flexible way to centralize and manage logging in your applications.

Installation

You can install Gutter using either npm or Yarn:

Using npm

npm install gutter-logger

Using Yarn

yarn add gutter-logger

Usage

Using Gutter with Polyfill

1. Import Gutter and Polyfill: Import the Gutter class and useGutterPolyfill function in your TypeScript project.

import Gutter, { useGutterPolyfill } from 'gutter-logger';

2. Replace Console with Gutter (Optional): You can choose to replace the default console with Gutter for seamless integration.

useGutterPolyfill(apiUrl, appKey, enableConsoleLogging, debugMode);

By calling useGutterPolyfill, you replace the default console with a custom console that uses the Gutter logger as its underlying mechanism.

3. Logging: You can now use the modified console to log data to the remote API and/or the console.

console.log('This is a log message');
console.error('This is an error message');
console.warn('This is a warning message');
// Use other console methods as well, e.g., console.info, console.debug, etc.

Using Gutter with an Instance

1. Import Gutter: Import the Gutter class in your TypeScript project.

import Gutter from 'gutter-logger';

2. Create a Gutter Instance: Create an instance of the Gutter class, providing the API URL and optional configuration options.

const apiUrl = 'https://your-logdrain-api-endpoint.com';
const gutter = new Gutter(apiUrl, appKey, enableConsoleLogging, debugMode);
  • apiUrl: The URL of your log drain API.
  • appKey (optional): An application key to identify the source of logs (useful for multiple projects).
  • enableConsoleLogging (optional): Enable or disable console logging (default: true).
  • debugMode (optional): Enable debug mode to log errors and debug information (default: false).

3. Logging: You can now use the Gutter instance to log data to the remote API and/or the console.

gutter.log('This is a log message');
gutter.error('This is an error message');
gutter.warn('This is a warning message');
// Use other console methods as well, e.g., gutter.info, gutter.debug, etc.

Examples

Check the examples directory for usage examples and integration with popular frameworks and libraries.

Configuration

You can configure the Gutter instance when creating it, allowing you to customize its behavior according to your project's needs.

  • apiUrl: The URL of your log drain API.
  • appKey (optional): An application key to identify the source of logs (useful for multiple projects).
  • enableConsoleLogging (optional): Enable or disable console logging (default: true).
  • debugMode (optional): Enable debug mode to log errors and debug information (default: false).

Author

License

This project is licensed under the MIT License - see the LICENSE.md file for details.