The Case for lowercase

When you look at some of the most popular Node.js applications on the web you rarely encounter capitalization in module names.

With the advent of ES6 and its broader application in the Node.js ecosystem classes became more prevalent and more people have asked themselves:

Should I capitalize my filenames as well?



Let me elaborate

Some languages encourage filenames that match class names, like MyClass and 'MyClass.js'.

This is useful as you have a nice consistency in naming which gives a clean and streamlined impression of the code base.

Node tries to maintain its platform agnostic approach also down to the filename level. And Linux and Windows or macOS don't treat filenames in the same way. While for Windows MyClass and myclass are the same, this is not true for Linux.

So to ensure that a code of the form:

let MyClass = require('my-class');

stays portable, stick to lowercase when naming files.