JavaScript Library Detection

Let’s dig deeper into the JS library data and try to answer some common questions. I’ll be adding to this thread with different analyses. First up…

What are the most popular libraries?

SELECT
  library.value AS library,
  library.count AS volume,
  ROUND(library.count / total.count, 3) AS coverage
FROM
  UNNEST((SELECT APPROX_TOP_COUNT(lib.name, 10) FROM `httparchive.scratchspace.2017_04_15_js_libs` WHERE lib.name IS NOT NULL)) AS library,
  (SELECT COUNT(0) AS count FROM `httparchive.har.2017_04_15_chrome_pages`) AS total
ORDER BY
  volume DESC
Row	library		volume	coverage	 
1	jQuery		394296	0.822	 
2	jQuery UI	104193	0.217	 
3	Modernizr	76339	0.159	 
4	Bootstrap	61711	0.129	 
5	yepnope		54589	0.114	 
6	FlexSlider	39465	0.082	 
7	SWFObject	23054	0.048	 
8	Underscore	19283	0.04	 
9	Google Maps	16091	0.034	 
10	Moment.js	14834	0.031

Run it on BigQuery

Querying for the top 10 libraries shows that jQuery is way out ahead and jQuery UI leads the race behind it.


http://jsfiddle.net/8e5uobnb/4/

Getting more than the top 10 is as easy as changing the APPROX_TOP_COUNT arguments. But because jQuery has so much coverage, plotting everything linearly makes the smaller libraries’ data impossible to read.


http://jsfiddle.net/8e5uobnb/5/

Plotting the entire data in a logarithmically-scaled chart reveals the long tail.