title: What is the optimal number of lines of code per file in node.js?
body: <p>I know this is a slightly subjective question, but I would appreciate insight from experienced web app engineers.  </p>
  
  <p>I am currently working on a medium size webapp in node.js with a REST API/Single Page App type of architecture. On the server side I am always struggling to know when it is the best time to split a single file and use a require() to call a block of code. </p>
  
  <p>I understand that file complexity is unlikely to affect the final production server performance, I want to know the goldilocks range to balance readability with directory structure complexity.</p>
  
  <p>There is a similar question aimed specifically at classical languages like vb.net <a href="https://stackoverflow.com/questions/374262/is-there-a-recommended-number-of-lines-of-code-per-file">here</a> and there is an excellent question about web application architecture <a href="https://stackoverflow.com/questions/5778245/expressjs-how-to-structure-an-application/19623507#19623507">here</a>.</p>