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

@kuankuan/log-control

v0.2.3

Published

A more detailed log library

Readme

@kuankuan/log-control

一个更详细的 Node.js 日志库,提供灵活的日志级别、可定制的格式化器,以及多种多级日志记录器类型。

功能

  • 多种日志级别:ALL、TRACE、DEBUG、INFO、WARN、ERROR、FATAL、OFF
  • 可自定义日志格式和日期格式
  • 控制台、文件、可写流和事件触发器记录器
  • 易于集成到你的应用程序
  • 支持 TypeScript
  • 一个记录器可以拥有子记录器,可用于过滤日志记录
  • 使用 string-format 格式化日志消息

安装

npm install @kuankuan/log-control

用法

import logControl from '@kuankuan/log-control';

const app = new logControl.Application({ name: 'my-app' });

// 添加控制台记录器
app.addRecorder(new logControl.ConsoleRecorder({ startLevel: logControl.Level.All }));

// 添加文件记录器
app.addRecorder(new logControl.FileRecorder('./app.log'));

// 创建带有自定义路径的 logger
const logger1 = app.createLogger('module');
const logger2 = logger1.createLogger('submodule1');
const logger3 = logger2.createLogger('request');

// [DEBUG] [my-app] [_root] 这是一条调试信息
app.debug('这是一条调试信息');

// [INFO] [my-app] [module] 这是一条信息
logger1.info('这是一条信息');

// [WARN] [my-app] [module.submodule1] 这是一条警告信息
logger2.warn('这是一条警告信息');

// [ERROR] [my-app] [module.submodule1.request] 这是一条错误信息
logger3.error('这是一条错误信息');

API

Application

  • new Application(options: { name: string })
  • .addRecorder(recorder: Recorder): () => void
  • .createLogger(name: string): Logger
  • .all(message: any)
  • .trace(message: any)
  • .debug(message: any)
  • .info(message: any)
  • .warn(message: any)
  • .error(message: any)
  • .fatal(message: any)
  • .close(): Promise<void[]>

记录器

  • ConsoleRecorder
  • FileRecorder
  • WriteableRecorder
  • NullRecorder
  • EventEmitterRecorder

许可证

本项目采用 Mozilla Public License 2.0 许可。详情请参见 LICENSE