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 🙏

© 2025 – Pkg Stats / Ryan Hefner

epg-devlog

v0.0.7

Published

在开发epg项目过程中,我们之前希望看到程序运行的情况,会在界面创建一个div标签浮在界面最顶层,用于显示调试信息。但是随着项目的发展,这个调试信息越来越复杂,需要显示的信息越来越多,导致这个div标签越来越大,查看调试信息变的更加困难。因此,我们决定将调试信息输出到服务器,通过浏览器访问服务器查看调试信息。 ## 2. 介绍 epg-devlog是集前后端服务为一体的日志服务,通过浏览器访问本地启动的服务器地址,可以查看上报日志。并对可以对上报的数据进行筛选、排序、搜索、标记等操作。 ## 3.

Downloads

29

Readme

epg本地调试日志上报服务

1. 概述

在开发epg项目过程中,我们之前希望看到程序运行的情况,会在界面创建一个div标签浮在界面最顶层,用于显示调试信息。但是随着项目的发展,这个调试信息越来越复杂,需要显示的信息越来越多,导致这个div标签越来越大,查看调试信息变的更加困难。因此,我们决定将调试信息输出到服务器,通过浏览器访问服务器查看调试信息。

2. 介绍

epg-devlog是集前后端服务为一体的日志服务,通过浏览器访问本地启动的服务器地址,可以查看上报日志。并对可以对上报的数据进行筛选、排序、搜索、标记等操作。

3. 使用

3.1. 环境准备

  • mySQL 8.0+
  • node.js V20+

3.2. 下载代码

  • npm i epg-devlog -g

3.3. 指令执行

#  配置mysql基础信息,按提示根据你自己本地的mysql进行配置
   epg-devlog-setMysqlConfig

mysql配置成功后,注意配置的数据库需确保你本地mysql已手动创建,而数据库的表则不用,epg-devlog会自动创建。

#  启动服务
    epg-devlog start

3.4. 使用

在epg项目中,定义一个devLog方法,具体根据项目框架来定义,如某历史项目中:

/** 本地epg-devtool服务 */
var MOINTOR_BASE_URL = 'https://5qxjve-ip-58-42-244-88.tunnelmole.net' // 本地调试内网穿透地址
var notSupportReportStbs = ["CM201-1-CH"]
var openLocalDev = true; // 是否开启本地调试
/**
 * 字符串化数据 补充JSON.stringify
 * @param {object} data 需要stringify的数据
 * @returns 
 */
var stringifyData = function (data) {
  return JSON.stringify(data, function (_key, value) {
    if (typeof value === "function") {
      return value.toString();
    } else if (typeof value === "undefined") {
      return "undefined";
    } else if (value === null) {
      return "null";
    } else {
      return value;
    }
  })
}
/**
 * 测试环境本地调试日志上报
 * @param {object | string} data 上报的数据
 * @param {string?} tip 提示信息
 * @param {string?} type 上报类型  info: 一般打印信息  warn:警告  error:报错   debug:调试 
 */

var devLog = function (data, tip, type) {
  if (!openLocalDev) return;
  if (MOINTOR_BASE_URL) {
    data === undefined && (data = "undefined");
    data === null && (data = "null");
    var reportData = { reportJson: data, tip: tip || "", type: type || 'info' };
    XEpg.Util.ajaxPostByJson(MOINTOR_BASE_URL + "/reportEpgLog", stringifyData(reportData), function(){})
  } else if (log_view && data) {
    var logType = {
      info: 'i',
      warn: 'w',
      error: 'e',
    }
    log_view(logType[type] || 'i', typeof data === 'string' ? data : stringifyData(data));
  }
}

日志上报成功后,可在浏览器上打开本地上报地址,便可对收集到的数据进行查看,但目前对于一些盒子存在异常,本服务更适合用于对数据的抓取,而异常盒子则建议使用log_view进行日志上报。 上报的接口为:/reportEpgLog 请求方式: post 入参: - reportJson : 上报的数据 - tip : 提示信息 - type : 上报类型 info: 一般打印信息 warn:警告 error:报错 debug:调试 - isMarked : 是否标记

todo

  • [√] 全局指令
  • [√] 一键清除选中项
  • [√] tip\type\reportJson列筛选
  • [√] 一键清空所有数据
  • [] 标记功能
  • [] 置顶功能
  • [] 优化前端设计,用户可自行配置交互行为
  • [] 用户可自行配置表格显示的列
  • [] 增加将字符串输入转为json的便捷功能
  • [] 增加实时日志功能socket
  • [] 全局安装该仓库时,执行start时,server子包类的模块依赖找不到,应该需要用pnpm进行全局安装,但pnpm全局安装不了,有问题暂未解决