Re:Ask HN: JavaScript code base to read and learn from
by ahmadajmi on Monday August 04, 2014 @11:28AM
(#8132154)
Thanks so much Ivo for this very good list, yes I'm looking for ones for Node.js as you said they are more organized and cleaner. I will consider Angular first as I learn it theses days and will be great to learn from the source code.
There are also multiple camps which battle about whether too use semicolons at all and where to place commas that separate the individual parts of `var` statements. I'm not going to take any sides here, since I think that style is something everyone has to decide on their own :)
Now as for the code to read, there's obviously jQuery, but Angular.js is definitely a good read too these days.
https://github.com/angular/angular.js
If you're into parsing (or want to learn about it), there's also Esprima which is a JavaScript Parser written in JavaScript:
https://github.com/ariya/esprima
Taking a look at NPM might give you an idea of another syntax style, since commas are infront of the lines here and there are no semicolons:
https://github.com/npm/npm/tree/master/lib
And last but no least a shameless plug or two!
gbaasm this is a assembler for z80 GameBoy code (which takes assembly files and build a ROM) written by myself, it has a big focus on performance and is another example of lexing / parsing source code.
https://github.com/BonsaiDen/gbasm
For something short and sweet I got a minimal 2D physics engine here. Beware though, if you're new to physics simulation is can be quite hard to figure out what excactly is going on:
https://github.com/BonsaiDen/box