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

laog

v1.0.7

Published

A lightweight logging library for browsers with enhanced styles and extensibility.

Downloads

639

Readme

Laog 🪵

English | 简体中文

一个轻量级的浏览器日志库,具有增强的样式和可扩展性。✨

✨ 特性

  • 📊 支持多种日志级别:log, info, warn, error, verbose, silent
  • ⏰ 支持时间戳显示和自定义格式
  • 🔍 支持调用堆栈显示
  • 🎨 支持自定义日志样式
  • 📋 支持深度克隆对象参数

📦 安装

使用 npm 安装:

npm install laog

或使用 yarn 安装:

yarn add laog

🚀 使用示例

import Laog from 'laog';

// 创建一个默认实例
const logger = new Laog({
  level: 2, // 设置日志级别
  showTimeStamps: true, // 显示时间戳
});

logger.log('这是一个普通日志');
logger.info('这是一个信息日志');
logger.warn('这是一个警告日志');
logger.error('这是一个错误日志');

⚙️ 配置选项

interface LaogOptions {
  level: LogLevel; // 日志级别
  showTimeStamps: boolean; // 是否显示时间戳
}

🎚️ 日志级别

type LogLevel = 1 | 2 | 3 | 4;
type LogType = 'log' | 'info' | 'warn' | 'error';

🎨 日志样式

每种日志类型都有独特的样式和表情图标:

  • log: 📝 蓝色背景
  • info: ℹ️ 深蓝色背景
  • warn: ⚠️ 黄色背景
  • error: ❌ 红色背景

🤝 贡献

欢迎贡献代码!请访问 GitHub 仓库 提交 Issue 或 PR。

📄 开源许可

MIT License © 2024-Present