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

sourcemap-stack

v1.0.2

Published

map minified js code

Downloads

7

Readme

sourcemap-stack

参数定义

参数属性 | 说明 -----|----- mapUrl | sourcemap 地址链接,如果不填,表示sourcemap地址跟实际js路径一样 mapName | 参考webpack的地址格式,比如:[name].[hash].js.map mapEncrypt | 如果map文件放到跟js同目录下,一起发布到cdn上,处于安全考虑,可以使用对称性加密map文件,加密包使用encrypte,如果没有加密,这项不填 desc | js error 的堆栈信息

API

getStackByError

根据错误的stack error信息,提取出调动的堆栈关系

Input:

TypeError: console.logs is not a function
at n (http://localhost:8082/app.js:6:180422)
at a.clickme (http://localhost:8082/app.js:6:180791)
at Proxy.r (http://localhost:8082/app.js:6:1053)
at click (http://localhost:8082/app.js:6:172962)
at HTMLHeadingElement.t (http://localhost:8082/app.js:6:7539)

Output:

[
  {"filepath":"http://localhost:8082/app.js","row":"6","column":"180422","html":false},
  {"filepath":"http://localhost:8082/app.js","row":"6","column":"180791","html":false},
  {"filepath":"http://localhost:8082/app.js","row":"6","column":"1053","html":false},
  {"filepath":"http://localhost:8082/app.js","row":"6","column":"172962","html":false},
  {"filepath":"http://localhost:8082/app.js","row":"6","column":"7539","html":false}
]

getMapPath

根据map参数的配置,获取sourcemap地址
Output:

[
{"filepath":"http://localhost:8082/app.js","row":"6","column":"180422","html":false,"mapUrl":"http://localhost:8082/app.js.map"},
{"filepath":"http://localhost:8082/app.js","row":"6","column":"180791","html":false,"mapUrl":"http://localhost:8082/app.js.map"},
{"filepath":"http://localhost:8082/app.js","row":"6","column":"1053","html":false,"mapUrl":"http://localhost:8082/app.js.map"},
{"filepath":"http://localhost:8082/app.js","row":"6","column":"172962","html":false,"mapUrl":"http://localhost:8082/app.js.map"},
{"filepath":"http://localhost:8082/app.js","row":"6","column":"7539","html":false,"mapUrl":"http://localhost:8082/app.js.map"}
]

getRealStack

解析真正的调用关系

调用demo

// 获取请求内容
let params = this.ctx.request.body
// 获取调用堆栈
let stacks = sourcemapStack.getStackByError(params.desc)
// 增加map地址
sourcemapStack.getMapPath(stacks, params)
// 获取真实调用地址
stacks = yield sourcemapStack.getRealStack(stacks)

具体使用文章

https://qianduan.group/posts/59e5c3d0cf830d7057327c95