r/javascript • • Nov 27 '18

event-stream vulnerability explained

https://schneid.io/blog/event-stream-vulnerability-explained/
412 Upvotes

70 comments sorted by

View all comments

16

u/samjmckenzie Nov 27 '18

Why are minified libraries published onto npm? Is this standard practice?

11

u/schneidmaster Nov 27 '18

Sort of. It's a common practice from the days before module bundlers, where you would directly use the dependency in the browser via a `<script>` tag (or maybe concatenate it with grunt or whatever) and the size matters. Some folks still do this sort of thing via https://unpkg.com/. I think the closest thing to a "standard practice" is to ship a minified version for browsers and an unminified version for servers/module bundlers.

1

u/0xF013 Nov 28 '18

Also, the unminified version can be any transpilied version of JS or not even JS, so the consumer might not even be able to properly build it.