
JavaScript development is now arranged in approximately the way. In the NPM storage system, there are modules that are downloaded to the developer’s computer or on the server where the site works. One module may require the presence of another module, the one is the third and so on. The developer, using the module in his program, hopes that all the modules are available in NPM, and does not think about what the packages used depend on.
On March 23, developers from around the world noticed that something is wrong with their JavaScript programs. One of the warnings read: “NPM err! 404 'Left-Pad' is not in the NPM Registry. " This means that a package called Left-Pad is required to start the project, but it is not possible to get it. Many developers could not understand what happened: they never used such a module. However, other modules could be used, which you could simply not guess.
It turned out that the error was issued, since Azer Kochulu, a developer from Azdland, deleted his LEFT-PAD module from NPM.
The LEFT-PAD module is one of the most popular NPM packages. Over the past month, it was installed about 2.5 million times. Therefore, due to the removal of this program, even such large projects as a library for developing React interfaces from Facebook interfaces suffered. It does not directly include Left-Pad, but it is based on other modules that use other modules that use Left-Pad.
The Left-Pad package consists of only 11 lines. He looks like this .
This code takes three values - the line, length and symbol - and adds the symbol to the beginning of the line as many times as the difference between the length of the line and the given length. For example, if you call the LEFTPAD function with the arguments of Medusa, 10, “A”, then the result will be “AAAAMEMedusa”. This is necessary to format rows - for example, so that words of different lengths are located evenly. In fact, any programmer can write such a function, but it’s more convenient to just take the ready -made from NPM. This explains such a popularity LEFT-PAD.
Since this module was used millions of times, many programs depend on it. Therefore, when the package was deleted, many were at a loss.
Azer Kochulu removed his module for a reason, but in protest. As a supporter of free software, he did not want to obey the copyright holders.
It all started on March 11, when he received a letter from Kik , which makes the messenger of the same name. He was asked to rename one of his packages called Kik . Otherwise, the copyright holders threatened to send lawyers to him on trademarks, although they assured that they did not want to be “assholes in this situation”. Kochulu replied that this name was already busy for his open code projects, and refused. And then he sent them at all. “Haha, you really are assholes, went ** *** [much to hell],” he wrote.
Kik even offered Azero Kochul money for "inconvenience associated with the change of name." He replied: “Yes, you can buy it for 30 thousand dollars to compensate for my inconvenience to transfer my own project a bunch of corporate assholes.”
Finding no understanding from Azer Kochul, Kik turned to NPM, and there they agreed to help. The representative of the NPM wrote to the developer that he should change the name of his package. Kochulu came into indignation. “I have known you for many years and could never imagine that you would take the side of corporate lawyers who threaten the developers of open software,” he wrote. “I think that I have the right to remove everything I did from NPM.” And he deleted all 273 packages that he did.
When the developers noticed that when trying to contact Left-Pad, an error was given, NPM employees acted unprecedentedly: they returned the remote module.
The case with Left-Pad gave rise to countless disputes about the current web development device and copy. Some scolded Kik for pressure on the developers of open software, others criticized the developers who are lazy to write 11 lines of code, and so on. Based on this incident, the Left-pad.io website was jokingly created, which allows you to use the API module. And also offered to store the code not in NPM, but in tweets .
Vladimir Tsybulsky