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

@wyeg/logsy

v0.0.2

Published

Logsy - is a library for stylized logging of messages in the browser console. It allows developers to easily output structured and visual various messages with custom styles, tags and plugin support.

Readme

Logsy

About

Logsy is a lightweight and zero dependency library for stylized logging in the browser console. It helps developers easily output structured and visually distinctive messages with custom styles, tags, and plugin support.

📦 Installation

yarn add @wyeg/logsy

🚀 Quick Start

import { Logsy } from '@wyeg/logsy';

Logsy.log('App init completed');

📕 Documentation

Available Log Methods

| Name | Description | |------------------|-------------------------------| |Logsy.log() | General-purpose logging | |Logsy.info() | Informational messages | |logsy.warn() | Warnings | |Logsy.error() | Errors and exceptions | |Logsy.spinner() | Async operation spinner |

API Reference

All methods (except Logsy.spinner()) use the same API interface as console.log().

import { Logsy } from '@wyeg/logsy';

Logsy.log('Foo', { foo: 'bar' });
Logsy.info('Foo', { foo: 'bar' });
Logsy.warn('Foo', { foo: 'bar' });
Logsy.error('Foo', { foo: 'bar' }); 
// or 
Logsy.error('Foo', new Error('Error Message'));

Use Logsy.spinner() to indicate progress during asynchronous operations. The spinner message updates automatically when the promise resolves or rejects.

import { Logsy } from '@wyeg/logsy';

const fetchData = () => new Promise((resolve) => setTimeout(() => resolve({ user: 'Tom' }), 2000));
Logsy.spinner('User', fetchData());

Available options

| Name | Type | Description | |---------------|-------------------|--------------------------------------------------------| |logsy | boolean | Required flag to identify the object as Logsy options | |style | string | Custom CSS rules to style the message | |label | string | LogTags | Predefined or custom label used to tag the message |

import { Logsy } from '@wyeg/logsy';

Logsy.warn('Deprecated method', { logsy: true, label: LogTags.DEPRECATED });

Logsy.warn(
  'Field "card" is deprecated',
  { logsy: true, label: LogTags.DEPRECATED },
  { card: 123, cardNumber: 123 }
);

To customize label color, use the getLabelStyle() helper:

import { Logsy, getLabelStyle } from '@wyeg/logsy';

Logsy.error('Something failed', { logsy: true, style: getLabelStyle('red') });
Logsy.log('Styled message', {
  logsy: true,
  style: 'color: lightgreen; background-color: darkgrey;',
});

Plugins

Built-in

🕵️ 1. redactSensitiveDataPlugin Automatically redacts sensitive fields from log data:

import { Logsy, redactSensitiveDataPlugin } from '@wyeg/logsy';

Logsy.use(redactSensitiveDataPlugin);

Logsy.log('User', {
  email: '[email protected]',
  password: 'hunter2',
  token: 'abc123xyz',
  apiKey: 'secretkey123',
  profile: {
    creditCard: '4111111111111111',
    cvv: 123,
    other: 'safeValue',
  },
});

Output:

{
  email: '[email protected]',
  password: '********',
  token: '********',
  apiKey: '********',
  profile: {
    creditCard: '********',
    cvv: '****',
    other: 'safeValue'
  }
}

Sensitive fields:

  • phone
  • address
  • creditcardnumber
  • password
  • secret
  • token
  • apikey
  • accesskey
  • privatekey
  • sensitive
  • confidential
  • creditcard
  • ssn
  • socialsecuritynumber
  • bankaccount
  • bankaccountnumber
  • routingnumber
  • iban
  • pin
  • cvv
  • cvc
  • otp
  • onetimepassword
  • securitycode
  • authcode
  • authtoken
  • authsecret
  • authkey
  • jwt

🚧 2. devOnlyPlugin Prevents logging in non-development environments (NODE_ENV !== 'development'):

import { Logsy, devOnlyPlugin } from '@wyeg/logsy';

Logsy.use(devOnlyPlugin);

Logsy.log('This will only be logged in development');

Create new plugin

You can create custom plugins that transform log data or hook into the logging lifecycle.

export interface ILogsyPlugin {
    /**
     * Transform the log message and its arguments.
     * @param message The log message.
     * @param rest The rest of the arguments.
     * @returns An object containing the transformed message and arguments.
     */
    transform?: (message: string, rest: unknown[]) => {
        message: string;
        rest: unknown[];
    };

    /**
     * Called before the log message is emitted.
     * @param level The log level.
     * @param message The log message.
     * @param rest The rest of the arguments.
     */
    beforeLog?: (level: TLogLevel, message: string, rest: unknown[]) => void;

    /**
     * Called after the log message is emitted.
     * @param level The log level.
     * @param message The log message.
     * @param rest The rest of the arguments.
     */
    afterLog?: (level: TLogLevel, message: string, rest: unknown[]) => void;
}

Avaiables log levels are log, info, warn, error.

📜 License

Further details see LICENSE file.

📧 Contact

If you have any questions, suggestions, or issues, please create an issue in the GitHub repository or contact me at [email protected].