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

geek-tools

v1.0.15

Published

Geek+ libs

Downloads

20

Readme

Geek+ 开源工具库

系统前端工具库.

安装

# 安装
$ npm i geek-tools

使用(以日志管理工具为例)

# 导入日志工具
import { logger } from 'geek-tools'

# 导入上报日志的接口
import { logWrite } from '@/common/api'

# 配置项
const options = {
  isEnable: true,                // 启用 停止 (可以从系统参数中取值)
  isEnableJsErrorHandler: false, // JS异常收集上报开关
  level: 'ERROR',                // 记录权重大于等于"ERROR"的日志
  sendTimeout: 60,               // 上报函数触发间隔 (秒)
  sendQueueMax: 10,              // 队列暂存日志条数,累积到此数量后请求接口上报
  projectCode: 'SR-P-SD202108',  // 项目编号 企业微信工作台PM系统可查
  axios: logWrite,               // 日志上报接口 (可选)
  url: '/basic/v1/appLog/write', // 不涉及权限可配置url使用内部ajax
  user: 'admin'                  // 当前用户
}

# 初始化
const Logger = logger.init(options)

# 挂到vue原型
Vue.prototype.$GKlogger = Logger

# 使用
this.$GKlogger.error({
  message: '商品等级字典为空,检查接口返回数据'
})

# 紧急调整上报 level,  可以浏览器地址栏补充参数后刷新页面
?forcedUseLevel=info

模块划分

  • [ ] 日志管理 log
    • [ ] index
  • [ ] 工具函数
    • [ ] 获取浏览器信息 getBrowserInfo
    • [ ] 获取设备与系统信息 getDeviceAndOS
    • [ ] 获取服务器时间 getServerTime

License

  • MIT