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

wind-logger-miniprogram

v1.0.6

Published

风行前端行为日志收集模块,适配微信小程序

Readme

wind-logger-miniprogram

风行前端行为日志收集模块-微信小程序

安装

// 1. 在小程序开发工具

npm install wind-logger-miniprogram --save

// 2. 小程序开发工具选择 [工具] -> [构建npm]

不错的教程👇🏻👇🏻👇🏻

微信小程序如何引入npm包?

引入日志模块


import FxLogger from 'wind-logger-miniprogram'
const LOGGER_CONFIG = {
	app: 'logger-test',
	remote: 'https://action.fxscm.net/logger/v1/shopedi/loggers',
	defaultInfo: {
		appType: 'logger-demo-miniprogram'
	},
	customInfo: {
		actionType: ''
	}
}
// 创建日志实例
const $fxLogger = new FxLogger(LOGGER_CONFIG)
App({
	onLaunch() {
        // 挂载日志模块
		this.globalData.$fxLogger = $fxLogger
	},
	globalData: {},
	onError (error) {
        // 捕获error日志
		$fxLogger.runtimeInfo(error)
	}
})

使用方法

// 日志初始化
app.globalData.$fxLogger.init({
    username: '系统管理员',
    userId: '1'
})

日志初始化

// 切换用户
app.globalData.$fxLogger.setUserInfo({
    username: '用户01',
    userId: '2'
})

切换用户

// 发送成功日志
const logger = app.globalData.$fxLogger.actionInfo({
	message: '成功的日志消息1',
    // 公司定义的默认日志字段
    oneStageModule: '一级菜单1',
    twoStageModule: '二级菜单1',
     // 生产线定义的自定义日志字段
    actionType: 'demo按钮2'
})
setTimeout(() => {
	logger.success()
}, 1000)

发送成功日志

// 发送失败的日志
const logger = app.globalData.$fxLogger.actionInfo({
	message: '失败的日志消息'
})
setTimeout(() => {
	logger.error('服务器异常')
}, 1000)

发送失败的日志

// 对request请求进行捕获
fxRequest ({ url, data, query }) {
		return new Promise((resolve, reject) => {
		// 创建request日志
		const logger = app.globalData.$fxLogger.requestInfoStart({ url, data, query })
		setTimeout(() => {
			if (data.billType === '1') {
				const succesResponse = {
					result: true
				}
				// 成功日志的手收集
				logger.end({
					res: succesResponse
				})
				resolve(succesResponse)
			} else {
				const errorResponse = {
					result: false,
					message: '单据类型错误'
				}
				// 失败日志的收集
				logger.end({
					error: errorResponse
				})
				reject(errorResponse)
			}
		}, 1000)
	})
}

request请求日志