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

plum-blossom-node-utils

v1.0.17

Published

node工具类

Readme

node-utils

node工具类

包含类

  1. logger日志处理 :部分完成,使用请看demo
  2. 通过配置 node.utils.config.yml 实现整个工具类的统一配置(目前支持log模块的简单配置)
  3. 日志文件可输出到本地文件中持久化存储

node.utils.config.yml

这个文件在运行node命令的文件目录下配置

log模块 node.utils.config.yml

log:
  pid: true                       # 打印PID
  console: true                   # 控制台输出
  time: true                      # 打印时间日期
  out:
    path: ./logs                  # 输出日志文件夹
    name: 'YYYY-MM-DD HH:mm:ss'   # 名称格式
    ext: 'log'                    # 后缀
    size: 100                    # 文件按照大小分割 单位 M

样式

import {Logger} from '../src/index'
const logger = new Logger.Logger()
const testDemo:Array<any> = [
  "string",
  12313123,
  false,
  null,
  undefined,
  [1,2,3,4,5],
  {name:"test"},
  Symbol("test")
]

setInterval(()=>{
  testDemo.forEach((item)=>{
    logger.info(item)
  })
  logger.info("测试")
  logger.warn("测试")
  logger.error("测试")
},500)
[2022/1/11 下午3:28:37 INFO ] (pid: 12068) :  false
[2022/1/11 下午3:28:37 INFO ] (pid: 12068) :  初始化node.utils.config.yml
[2022/1/11 下午3:28:37 INFO ] (pid: 12068) :  { log: { pid: true, console: true, time: true } }
[2022/1/11 下午3:28:37 INFO ] (pid: 12068) :  { pid: true, console: true, time: true }
[2022/1/11 下午3:28:37 INFO ] (pid: 12068) :  string
[2022/1/11 下午3:28:37 INFO ] (pid: 12068) :  12313123
[2022/1/11 下午3:28:37 INFO ] (pid: 12068) :  false
[2022/1/11 下午3:28:37 INFO ] (pid: 12068) :  null
[2022/1/11 下午3:28:37 INFO ] (pid: 12068) :  undefined
[2022/1/11 下午3:28:37 INFO ] (pid: 12068) :  [ 1, 2, 3, 4, 5 ]
[2022/1/11 下午3:28:37 INFO ] (pid: 12068) :  { name: 'test' }
[2022/1/11 下午3:28:37 INFO ] (pid: 12068) :  Symbol(test)
[2022/1/11 下午3:28:37 INFO ] (pid: 12068) :  测试
[2022/1/11 下午3:28:37 WARN ] (pid: 12068) :  测试
[2022/1/11 下午3:28:37 ERROR ] (pid: 12068) :  测试

结束语

该模块会在后期集成更多的实用的功能,希望通过引入一个依赖,解决大部分问题,当然之后的模块会尽量以插件的形式引入,达到按需使用按需加载的目的

本人能力有限,不足之处一定积极改正,希望大家多提意见,共同进步

同时希望你们一起维护,一起加入,共同创造属于自己的好工具,