SOURCE from: http://www.techug.com/node-js-community
A few days ago, a contributor to the node. JS Package Manager community, Azer Koçulu, for the sake of the NPM management, quietly removed all of his code on NPM, which contained only 11 lines of code "Left-pad", and did not expect From Beijing to Silicon Valley in the United States, from college dormitories to New York-based engineers, to Facebook's senior engineer, the entire Internet community blew up the pot, and many of the node. JS modules in their hands were all on strike.
Although NPM administrators have been forced to rewrite the code that released Azer Koçulu after the crisis, the NPM storm is undoubtedly far-reaching.
To understand NPM, you first need to know about node. js. node. JS is a Javascript-based back-end programming framework that can be interpreted as a substitute for PHP by developing the language of the website. The most obvious feature of node. JS is that, in addition to the Javascript language, there are many common modules that are contributed by developers from all over the world, and these modules are managed by NPM, and NPM is a bit like Apple's APP store, except that the modules are free to use.
Azer Koçulu is a passionate fan of NPM, often contributing code for NPM, one of which has a module called Kik, but this module may be rudimentary, or it may be not high-profile, anyway, with few people, there is no sense of existence. Coincidentally, just one company, also known as Kik, is a similar social tool.
Kik also used the name Kik in the NPM community, so he sent a lawyer to Azer Koçulu, who asked him to change his kik to another, or there would be a lawyer to find the door. Azer Koçulu think Kik company said very reasonable, and then refused. After all, the name should not be first come first served? I will believe what you say, and I will do whatever you want me to do. And I didn't do anything wrong, I didn't know there was a Kik company when I first started writing the Kik module.
Kik company negotiations failed, directly to the NPM official complaints, not long, NPM community administrator did not pass Azer Koçulu I agree, put his in NPM above the Kik module control to others.
This azer Koçulu is going to explode, for NPM disappointed, did not expect the NPM community is this kind of thing, protect big company, disregard individual developer. This is simply a disgrace to your own values.
Anger is hard to suppress, Azer Koçulu decided to revenge, he will break with NPM, all of a sudden erased his own on the NPM above all the code. Among them are the popular component "Left-pad". This component has only 11 rows, and the function is simply to insert the given character repeatedly to the left of the given string to achieve the desired string length.
This node. JS module is simple, but is widely used and downloads more than 570,000 times. The Babel module was used in large software projects by famous companies such as Facebook, Spotify and Netflix, and Bel originally called the "Left-pad" module. It is also affected by today's well-known React framework, which helps front-end engineers develop web interfaces more easily, while programmers around the world who learn the React framework at the same time may be millions of, but all of a sudden they can't be used. According to the NPM official blog, "Left-pad" was deleted after the affected module reached thousands of.
This is like the engine of the plane suddenly dropped a screw, the ignition system will definitely error, but you are difficult to locate the source of the problem. After all, node. JS uses a chain of design ideas, you call the module may call other modules, other modules also call their own other modules, layer after layer, the code volume thousands, positioning and repair all the problem code, the project is vast.
The accident quickly in Twitter, and micro-bo fried pot, many netizens reaction React, Babel, Ember can not use, a few hours later also have netizens reflect Babel has launched an emergency repair version.
4 hours after the accident, the NPM community administrator decided to shoot, the name "Left-pad" from the Azer Koçulu hand to take back, re-wrote a "Left-pad" function, finally smoothed the hearts of millions of programmers restless.
After the accident, many developers began to doubt the management capabilities of NPM, the huge node. JS community is dangerous, in the future if a contributor mistakenly manipulated or password stolen, countless node. JS developers around the world will not work. There are also doubts about NPM's philosophy of design, why not design the official standard library, but rather the design of a dozen or even 1 lines of code into separate modules. For example, there is a module called IsArray, download volume reached 880,000 times, in fact, only 1 lines of code.
Programmer's Revenge: 11 lines of code How to make the node. js Community Chicken Fly Dog Jump