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 🙏

© 2024 – Pkg Stats / Ryan Hefner

mo-logs

v1.0.6

Published

a log modules

Downloads

5

Readme

mo-logs日志系统

为了能让打印出来的信息保存到本地,方便查看而诞生的小模块。

安装

npm install mo-logs

使用指南

引入模块

通过var ml = require('mo-logs')引入模块。

自定义配置

使用ml.SetConfig(option)可进行自定义配置。

option配置项:
  • path:日志路径,默认为**'/logs'**
    • 传入路径为String字符串,可使用相对地址,也可用绝对地址
  • level:日志级别,默认为**'1'**
    • 日志级别分为debugwarninfoerror
    • 级别为1时会打印所有日志
    • 级别为2时只打印warninfoerror日志
    • 级别为3时只打印infoerror日志
    • 级别为4时只打印error日志
  • flag:是否开启控制台打印,如果为true则在打印日志文件的同时输出至控制台,默认为false。
    • 数据类型为boolean

例:option = {path: 'e:/xxx', level: '1', flag: true}

打印日志

使用ml.debug(String) || ml.warn(String) || ml.info(String) || ml.error(String)将内容打印至日志文件中。

当天第一次打印日志时,会自动将之前的历史日志移入history目录中。

日志级别请参考自定义配置

功能列表

已完成

  • 创建日志文件并打印
  • 集成了console.log()方法
  • 自定义日志输出路径
  • 配置并分类日志输出级别

开发中

  • 自动清理日志
  • 自定义清理日志的规则

License

The ISC License