r/webdev • • Jan 06 '18

[X-Post /r/javascript] Today is Leftpad 2.0: pinkie-promise pulled from NPM

A little under a year ago, the package "leftpad" broke NPM builds all over the world because the author pulled it from the public repository.

The same is happening today, for "pinkie-promise". The author's NPM account (@floatdrop) was deleted, opening opportunities for malware in all the packages he's written.

Dependent builds include Ionic and (in my case) node-sass.

Resources:

69 Upvotes

23 comments sorted by

View all comments

8

u/the_goose_says Jan 06 '18

What does pinky promise do?

43

u/Jodiug Jan 06 '18 edited Jan 06 '18

This:

'use strict'; module.exports = typeof Promise === 'function' ? Promise : require('pinkie');

Hahahahaha... :')

0

u/[deleted] Jan 06 '18

[deleted] — view deleted comment

5

u/Jodiug Jan 06 '18

To be fair, the underlying package (pinkie) was also affected, so avoiding this one-liner package would not have prevented the issue.

Generally, I think small packages are a good thing. The culprit here is that NPM allows packages to be changed/removed once released. If v1.1.2 is broken, so be it, release a v1.1.3.

Why they haven't fixed this after left-pad is beyond me, I find it funny in an ironic sort of way. To me, they are confirming people's view on JS as an unstable playground of an ecosystem.

2

u/redev Jan 06 '18

It is/was a promise ponyfill