taoqf / node-html-parser

A very fast HTML parser, generating a simplified DOM, with basic element query support.
MIT License
1.12k stars 112 forks source link

Switch from 'he' to 'lean-he' (or my forked 'lean-he-esm') #117

Closed jogibear9988 closed 3 years ago

jogibear9988 commented 3 years ago

As you only use decode from he, code size could be minimized using lean-he.

I've forked lean-he and created a typescript / esm version https://github.com/node-projects/lean-he

Cause when you use esm modules directly without transpiler, loading of the he imports will fail

jogibear9988 commented 3 years ago

I've don this fix in my fork: https://github.com/node-projects/node-html-parser/commit/3a88678eea484448c1276f80fb7f41b51f1ed66a

taoqf commented 3 years ago

Thanks, he seems caused an serious memory leak, can you help?

taoqf commented 3 years ago

https://github.com/taoqf/node-html-parser/issues/106

jogibear9988 commented 3 years ago

No, I have not really looked deeply into he/lean-he. I only changed the files to .ts, fixed ES6 imports and published to npm