What are the naming conventions for files and folders in a large Node.js project?
Should I capitalize, camelCase, or under-score?
Ie. is this considered vali
There are no conventions. There are some logical structure.
The only one thing that I can say: Never use camelCase file and directory names. Why? It works but on Mac and Windows there are no different between someAction and some action. I met this problem, and not once. I require'd a file like this:
var isHidden = require('./lib/isHidden');
But sadly I created a file with full of lowercase: lib/ishidden.js. It worked for me on mac. It worked fine on mac of my co-worker. Tests run without errors. After deploy we got a huge error:
Error: Cannot find module './lib/isHidden'
Oh yeah. It's a linux box. So camelCase directory structure could be dangerous. It's enough for a colleague who is developing on Windows or Mac.
So use underscore (_) or dash (-) separator if you need.