JoshuaKGoldberg / package.json-validator

Tools to validate package.json files
MIT License
107 stars 26 forks source link

🚀 Feature: Check for weird built-in node modules #54

Open pdehaan opened 8 years ago

pdehaan commented 8 years ago

I've seen a ton of modules that specify fs and path in their dependencies. http://npm.im/fs

It may be a bit hacky, but you could possibly store an array of built-in Node modules from https://nodejs.org/dist/latest-v6.x/docs/api/ (ie: "assert", "buffer", "child_process", "fs", "http", "path", etc) and then display warnings if the package.json uses any of those built-in modules.

Of course, there may be a valid reason to use the npm version of "path", so I guess they shouldn't be fatal errors, but I find most people may do npm i fs path -S by mistake and often don't want them or understand they have been built-in since Node 0.1. :shrug: