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

@idlebox/logger

v0.0.16

Published

A simple logger module for my self use (nodejs).

Readme

日志工具

全局logger对象

import { logger, createRootLogger } from "@idlebox/logger";

createRootLogger('myapp'); // 如果tag为空,则不受“DEBUG”环境变量控制,无条件显示;DEBUG_LEVEL仍然生效
logger.log`debug message`;

模块logger对象

import { createLogger } from "@idlebox/logger";

const logger = createLogger('myapp:module');
logger.log`debug message`;

环境变量

|环境变量|描述|默认值| |:---|:---|:---| |DEBUG|调试模式,格式类似“模块1,模块2,模块3”,也可以用空格。底层调用debug包实现判断 || |DEBUG_LEVEL|日志级别(verbose, debug, info, "", warn, error)|| |NO_COLOR|禁用颜色,任何非空的值都为真|| |NODE_DISABLE_COLORS|同上,但只支持“1”|0| |FORCE_COLOR|强制启用颜色,任何非空的值都为真||

注意: 如果命令行存在--verbose-d, --debug参数,会覆盖DEBUG_LEVEL环境变量,两个-d=--verbose,不支持-v

可用命令

const veryLongString = "This is a very long string that might be truncated in logs";
logger.log`don't truncate: long<${veryLongString}>`;

|命令|描述| |:---|:---| |long|不要省略超长字符串、数组| |inspect| 使用util.inspect()来格式化对象 | |stripe| 单行显示(转义回车等字符) | |list|以列表形式展示,要求参数为Iterable对象,且结果为string[string, string](也可以是实现toString()的对象)| |commandline|优化显示命令行参数| |relative|路径转换为相对于当前工作目录| |printable|删除非可打印字符(序列)|