Fixing “inherits” package.json file

The “inherits” module (written by the creator of npm, Isaac Z. Schlueter) is quite an old piece of code (First published in 2011). It has over 1 million downloads per day, and over 25 million downloads last month! One might think that a popular module like this one shouldn’t have any errors in them. Well… after looking at its package.json file, I noticed that it didn’t follow npm standards.

As you can see, there were a few missing fields (Even though they aren’t required by default). Although the repository field had a valid link, it was missing the “type” field. Now, why would he create a package.json file that doesn’t follow his own standards? Who knows really. Being an old module, I believe that this is the main cause for this oversight (The standards might have changed since 2011). If something is working the way you expect it to, then there’s no reason to believe you missed something.

After looking at other npm modules, I noticed that over 40% of them have package.json files that doesn’t follow npm standards. What if someone were to write a bot that can check for invalid package.json file and fix them? Now that would be something 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.