I'm glad to see this in an article for JavaScript projects. Here are a few articles for Java projects, that go in more details (I think the concepts still mostly apply to JavaScript projects):
http://www.javapractices.com/topic/TopicAction.do?Id=205
http://www.codingthearchitecture.com/2015/03/08/package_by_c...