mathiasbynens / he

A robust HTML entity encoder/decoder written in JavaScript.
https://mths.be/he
MIT License
3.43k stars 255 forks source link

Modular usage #64

Open shrpne opened 6 years ago

shrpne commented 6 years ago

Would be great if he methods could be imported separately to decrease overall app size

rmariuzzo commented 6 years ago

I agree, the current size is a little bit big.

he 1 1 1 bundlephobia 2018-06-22 12-11-53

adnaan1703 commented 6 years ago

yeah looking forward to this.

Norbz commented 6 years ago

We have the same issue here, had to add the dependency for a project with a third party API, only one call. That methods costs us 50 KB just for a list of cities to be displayed on a combobox ;)

Not sure how this could be splitted though

adnaan1703 commented 6 years ago

Just made lean-he for my use case, forked from this very repo. Please see if this can help others.

wordythebyrd commented 5 years ago

@adnaan1703 how big is lean-he?

shrpne commented 5 years ago

also if you need only decode method you can use entity-decode, it is only 373B for browser, but if it is used in the node.js it loads he and for node.js size doesn't matter

dandv commented 4 years ago

@mdevils' html-entities library is a little smaller, about as popular in terms of NPM weekly downloads, and more recently updated.

@fb55's entities is even smaller and faster.