WitipediaIt's funny because it's true.
Create account Log in

Left-pad

From Witipedia, the funny encyclopedia
Left-pad
Date22 March 2016
Registrynpm
What it didpad the left side of a string
Lengtheleven lines
Unpublished withthe author's kik package and 272 others
Restoredthe original version 0.0.3, from a backup, the same afternoon

Left-pad is a JavaScript package that pads the left-hand side of a string. It was eleven lines long. On 22 March 2016 its author, Azer Koçulu, unpublished it from npm, together with a package called kik and 272 others, after a dispute over the name kik. Shortly after 2:30 in the afternoon, Pacific time, npm began to see hundreds of failed installs a minute. Projects that had never named left-pad were failing because something they used had named it.[1][2]

Within ten minutes another developer, Cameron Westland, published a functionally identical left-pad, as version 1.0.0. That was allowed: an abandoned name can be reused, so long as the version numbers are new. It did not fix the builds that had asked for version 0.0.3.

The version that was named[edit]

A number of dependency chains, including Babel and Atom, brought left-pad in through a package called line-numbers, which requested 0.0.3 in particular. A new 1.0.0 is a different version. npm republished the original 0.0.3 from a backup. Republishing a version that has been unpublished is not otherwise possible. The company announced the plan at 4:05 and finished it at 4:55. Its account calls the step unprecedented, and says the decision put the interests of the people whose builds were failing against the wishes of the author. They chose the builds.[1]

The code that failed was a loop that adds characters to the front of a string. It failed because it was no longer at the address thousands of other programs had written down.

See also[edit]

References[edit]

  1. ^ npm, Inc., "kik, left-pad, and npm", npm blog, March 2016.
  2. ^ "A single Node of failure", LWN.net, 30 March 2016.

Rate this article

Two questions, two separate answers. An article can be useless and hilarious, or accurate and dull; the ratings are kept apart so editors can tell which problem they have. Anonymous ratings are counted per IP address.

Was this helpful?Did you actually learn the thing? No ratings yet
Was this funny?Did the joke land, and was it true? No ratings yet