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

html-parser2

v1.0.2

Published

html解析与相关节点API接口

Readme

安装方法

    npm install html-parser2 -s
/**
作者:阮家友
时间:2017-5-12 10:53:43
说明:html Node节点对象
      2017-5-15 14:18:01 修改_calc中bFound为false时的bug
      2017-5-15 22:15:05 es6改写
      2017-6-2 15:04:54  innerText中while死循环bug
      2017-7-8 16:14:20  debug:有时获取到了数据但timeout了 ...
      2017-8-4 19:46:54  解决引号中的引号转义问题
      2017-9-2 10:21:23  parse传入的html不是字符串 bug处理 
                         构造中传入html进行初始化
                         增加toString()方法
                         解决最后面的文本没有变成节点的bug
      2017-9-17 17:54:25 补充toJSON方法
      2017-9-18 00:22:20 发现解析节点时字符串中的换行之类的空白字符造成节点被识别为文字 心累 全replace吧
      2017-9-18 14:14:27 removeChild有问题 奇怪 添加remove方法
      2017-9-18 17:39:29 $方法补充分组,
      2017-9-19 15:39:05 改写$
      2017-9-20 17:20:18 解决文本中有引号的bug 字符串只能在标签内
      2017-9-22 23:12:13 script标签中有标签字符串的bug:textarea、xmp、pre、code、
                         strong、em、font、img、q、b、quoteblock、pre、s、small、span、label、sub、sup、
      2017-10-1 04:34:22 要改的地方 node改为tag,内部方法用前缀_,bfs改为异步,但bfs中修改节                 点是个大问题
                         Text属性改为text,
      2018-2-2 16:53:30  token词法分析,vQuery函数工厂
      2018-2-6 15:42:20 纠错:HTML解析时遍历修改所有ST节点;标签中多了个引号....怎么办? 简单的判断字符串前是不是=
**/

2017-11-26 23:38:53

    1.基本的Node处理
    2.html片段解析
    3.添加测试

2017-12-9 14:47:26

    参考superagent封装shttp

2017-12-17 15:18:00

    解决nodejs循环引用问题(放在同一个文件~~ 用babel或者等v8更好~~)

2017-12-17 18:00:13

TODO:$选择器与util中的_

2018-1-15 09:39:36

    更新uri-parser-helper版本

2020-12-27 02:17:49

  • 修改removeAttr()的bug