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

sourcemapping

v1.0.8

Published

mapping to source code

Readme

Sourcemapping

介绍

一个本地JavaScript混淆堆栈解析npm命令行工具,用于收集外网JavaScript错误日志的解析。考虑到发布环境不attach sourcemap文件,收集到的错误堆栈都是混淆过的,需要一个解析工具进行解析,映射到源文件。

  • 本工具基于官方映射工具source-map以及error-stack-parser工具
  • 专门针对前端window.onerror捕捉到的JSON.stringfy(errorObj.stack)进行解析
  • 根据堆栈中的每一帧信息找指定路径下对应的sourcemap文件进行解析,最终生成映射到源码后的堆栈信息

用法

需要传入window.onerror中捕获的JSON.stringfy(errorObj.stack)即需要被解析的堆栈字符串,以及存放sourcemap文件的相对路径。

sourcemap文件命名为各压缩混淆工具的默认规则:javascript文件名.map,需要直接存放在指定路径下

安装

npm install sourcemapping -g
Usage: sourcemapping [options]

Options:
  -v, --version         output the version number
  -s, --stack <string>  stack string which can obtain from JSON.stringfy(Error.stack)
  -m, --map <string>    sourcemap dir path. Where to find sourcemap
  -h, --help            output usage information

sourcemapping -s "ReferenceError: exclued is not defined\n    at getParameterByName (http://localhost:7777/aabbcc/logline.min.js:1:9827)\n    at http://localhost:7777/aabbcc/index.js:15:11" -m "./test"

输出

----Sourcemap Result----
Uncaught ReferenceError: exclued is not defined
    at Logline (../src/logline.js:62:31)
    at (index.js:15:11)
------------------------

测试

工具使用TypeScript编写,修改源码后调试测试可以使用如下命令:

npm install
npm run test