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

@starkow/logger

v2.3.1

Published

simple yet effective logger

Readme

@starkow/logger

why?

  • i wanted to make it by my own
  • it's gorgeous i think
  • fixed colors for static names (logger name 'foo' will produce deterministic yet still random color every time)!
  • it have log level
  • file logs exist Yes👍
  • yeah

usage

import { Logger, Color, TextStyle } from '@starkow/logger'

const log = Logger.create('foo') // log will be given random yet deterministic color

log('bar', Logger.color('baz', Color.Red, TextStyle.Bold), ':)')

alternative imports:

import { Logger } from '@starkow/logger'
import { Color, TextStyle } from '@starkow/logger/colors'

log levels

priority:

  1. LogLevel.Generic - log(...), log.log(...)
  2. LogLevel.Info - log.info(...) + all the above
  3. LogLevel.Debug - log.debug(...) + all the above
  4. LogLevel.Warn - log.warn(...) + all the above
  5. LogLevel.Error - log.error(...) + all the above

default log level is LogLevel.Error

import { Logger, LogLevel } from '@starkow/logger'

Logger.config.setLogLevel(LogLevel.Info) // only Info and lower will be logged

const log = Logger.create('@starkow/logger')

log('is cool!')
log.info('is the best!')
log.debug('sucks') // we dont want this to be logged so we chose LogLevel.Info instead of LogLevel.Debug

filelogs

import { resolve } from 'node:path'

import { Logger } from '@starkow/logger'

Logger.config.setFilePath(resolve(__dirname, 'epic.log'))

Logger.create('this will be logged')('into a file!', { 42: true })

file {__dirname}/epic.log will look like this:

2023-10-05T22:47:16.630Z [this will be logged] into a file! {"42":true}

reference

Logger.create(name: string, ...colors: AnyColor[])

Initializes logger function

Returns: LoggerInstance

Logger.create('bot', Color.Green, TextStyle.Underline)('started!')

Logger.log(...), Logger.error(...), Logger.warn(...), Logger.debug(...), Logger.info(...)

Logs data to chosen stream

Logger.log('foo', { bar: 'baz' })
Logger.error('error!')
Logger.debug({ type: 'paid', amount: 13.49 })

Logger.prefix(name: string, ...colors: AnyColor[])

Generates current logger prefix

Returns: string

const prefix = Logger.prefix('server', Color.Cyan)

Logger.log(prefix, 'started!')

Logger.color(text: string, ...colors: AnyColor[])

Colorizes given text with given colors

Returns: string

const coloredFoo = Logger.color('foo', Color.Magenta, BackgroundColor.White)

Logger.log(coloredFoo)

Logger.updateLog(text: string, params?: LogUpdateParams)

Updates last log line

Returns: void

Logger.log(      'Loading:   9%'        )
Logger.updateLog('Loading:  45%'        )
Logger.updateLog('Loading:  77%'        )
Logger.updateLog('Loading: 100% [Done!]')

LoggerInstance

const log = Logger.create('logger')

(...data: any[]): void, log(...data: any[]): void

log(    'foo', ['bar', 13.37])
log.log('foo', ['bar', 13.37])

update(...): void

log('1')
log.update('2')
log.update('3')

error(...): void

log.error('failed!')

warn(...): void

log.warn('something is about to crash!')

debug(...): void

log.debug({ 42: 'the truth' })

info(...): void

log.info('this log is very mandatory keep listening to me i swear')