This is a collection of JavaScript codebases to read. They're separated into 3 categories based on rough size.
Name | Description | LOC | Stars |
---|---|---|---|
JSON in JavaScript | Douglas Crockford's implementation of JSON | ~800 | |
Redux | State management library | ~380 | |
Hyperapp | 1 kB JavaScript framework for building web applications. | ~340 | |
Preact | ⚛️ Fast 3kB React alternative with the same modern API. Components & Virtual DOM. | ~650 | |
left-pad | ⬅️ String left pad | ~30 |
Name | Description | LOC | Stars |
---|---|---|---|
Lodash | A modern JavaScript utility library delivering modularity, performance, & extras. | ~2500 | |
Backbone.js (Annotated source) | Give your JS App some Backbone with Models, Views, Collections, and Events | ~1200 | |
Underscore.js (Annotated source) | JavaScript's utility _ belt | ~1200 | |
Express.js | Fast, unopinionated, minimalist web framework for node. | ~1800 | |
Moment.js | Parse, validate, manipulate, and display dates in javascript. | ~3500 | |
Immutable | Immutable persistent data collections for Javascript which increase efficiency and simplicity. | ~5000 | |
handlebars.js | Handlebars provides the power necessary to let you build semantic templates effectively with no frustration. | ~2700 | |
Ramda | 🐏 Practical functional Javascript | ~4000 | |
jQuery | jQuery JavaScript Library | ~6200 | |
Zepto.js | Zepto.js is a minimalist JavaScript library for modern browsers, with a jQuery-compatible API | ~2100 | |
Matter.js | a 2D rigid body physics engine for the web ▲● ■ | ~5000 |
Name | Description | LOC | Stars |
---|---|---|---|
React | A declarative, efficient, and flexible JavaScript library for building user interfaces. | ~75k | |
Angular | One framework. Mobile & desktop. | ~70k | |
AngularJS | AngularJS - HTML enhanced for web apps! | ~20k | |
npm | a package manager for JavaScript | ~14k | |
Vue.js | 🖖 A progressive, incrementally-adoptable JavaScript framework for building UI on the web. | ~13k |
Why did you make this?
Reading code is a great way to get a better understanding of a language by seeing how other people have done things. I wanted to have one place to keep a list and share it with the community.
Why didn't you include my favorite library foo.js?
Probably because I didn't think of it when making this list! Feel free to open a PR or an issue!
Why aren't your LOC calculations scientific?
It's much more important to get an idea of the general size of a library than it is to know exactly how many lines are in it. Most of these libraries are living codebases, and any specific number would also quickly be out of date.
If you have any recommendations, please open an issue or a PR! Include a snippet about the code and your reasons why it should be included. The more the merrier!
I use a markdown table generator like this to generate the tables. If you're adding to a table, copy the markdown, paste it in, add a row, and generate it! I'll be doing the same to double check formatting is all set.
For star badges, I use http://shields.io/.
For lines of code, I use loc. I try to run it on only the src
(or analogous) directory, and I only use the lines of JavaScript code (not including blank lines or comments).
For instance, here's the output from redux:
Coding: $ ./loc redux/src/
--------------------------------------------------------------------------------
Language Files Lines Blank Comment Code
--------------------------------------------------------------------------------
JavaScript 9 653 68 201 384
--------------------------------------------------------------------------------
Total 9 653 68 201 384
--------------------------------------------------------------------------------
Although there may be many helpful comments, the total number of JS lines is a better way to understand size across packages.