HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
madrobby
zepto
HTML2010–2021
madrobby / zepto

zepto

Zepto.js is a minimalist JavaScript library for modern browsers, with a jQuery-compatible API

14Distinct people
14Mentions
0Explicit recommenders
15KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Zepto.js is a minimalist JavaScript library for modern browsers, with a jQuery-compatible API

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year14 dated mentions

Observed mentions: 2010-10-28 17:13:39 UTC to 2021-09-06 13:39:28 UTC.

01232010-01-01 00:00:00 UTC to 2011-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20102011-01-01 00:00:00 UTC to 2012-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments2012-01-01 00:00:00 UTC to 2013-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments20152016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2021

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20102010-01-01 00:00:00 UTC2011-01-01 00:00:00 UTC101
20112011-01-01 00:00:00 UTC2012-01-01 00:00:00 UTC211
20122012-01-01 00:00:00 UTC2013-01-01 00:00:00 UTC303
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC101
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC303
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC000
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC101
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC000
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC101
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC000
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC101
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC101

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
Zepto.js – a minimalist JavaScript library Zepto is a minimalist JavaScript library for modern browsers with a largely jQuery-compatible API. If you use jQuery, you already know how to use Zepto. See zeptojs.com for an extended introduction, downloads and documentation. Zepto.js is licensed under the terms of the MIT License. Want to give us money or a tip? Don't. Instead please donate to charity: water. Building The official site offers a download of the default distribution of Zepto. This is good for starting out. However, at some point you might want to add some optional modules and remove some of the default ones you don't need, to keep the size at a minimum. That's when you need to check out Zepto's source code and use the build commands. You will need Node.js installed on your system. $ npm install $ npm run-script dist # do a custom build $ MODULES="zepto event data" npm run-script dist # on Windows c:\zepto> SET MODULES=zepto event data c:\zepto> npm run-script dist The resulting files are: dist/zepto.js dist/zepto.min.js If you install CoffeeScript globally, you can run make directly: # one-time operation $ npm install coffee-script --global $ coffee make dist $ MODULES="zepto event data ..." ./make dist # on Windows c:\zepto> SET MODULES=zepto event data c:\zepto> coffee make dist Zepto modules Zepto modules are individual files in the "src/" directory. module default description zepto ✔ Core module; contains most methods event ✔ Event handling via on() & off() ajax ✔ XMLHttpRequest and JSONP functionality form ✔ Serialize & submit web forms ie ✔ Support for Internet Explorer 10+ on the desktop and Windows Phone 8 detect Provides $.os and $.browser information fx The animate() method fx_methods Animated show, hide, toggle, and fade*() methods. assets Experimental support for cleaning up iOS memory after removing image elements from the DOM. data A full-blown data() method, capable of storing arbitrary objects in memory. deferred Provides $.Deferred promises API. Depends on the "callbacks" module. callbacks Provides $.Callbacks for use in "deferred" module. selector Experimental jQuery CSS extensions support for functionality such as $('div:first') and el.is(':visible'). touch Fires tap– and swipe–related events on touch devices. This works with both `touch` (iOS, Android) and `pointer` events (Windows Phone). gesture Fires pinch gesture events on touch devices stack Provides andSelf & end() chaining methods ios3 String.prototype.trim and Array.prototype.reduce methods (if they are missing) for compatibility with iOS 3.x. Contributing Please read our contribution guidelines for information on how to contribute. Get in touch: @zeptojs Write documentation Zepto docs are written in Markdown and live in the "gh-pages" branch. They are published on zeptojs.com. You can use GitHub's web interface to make quick changes to documentation for specific Zepto features (example: ajaxSettings). This will submit a pull request to us that we can review. Report a bug Check if the bug is already fixed in the master branch since the last release. Check existing issues. Open a new one, including exact browser & platform information. For better formatting of your report, see GitHub-flavored Markdown. Running tests You will need to install PhantomJS. On OS X, that's easy: $ brew install phantomjs To run the automated tests: $ npm test To run a test server, which you can hit with your browsers and devices: $ npm start Go to http://your-ip-address:3000/ on your browser and follow the instructions. For your convenience test failures and exceptions will be reported to the the console you started the test server in (as well as the browser console if available).
Read the full README on GitHub

What Hacker News says

14 sources
I'm going to propose one of my own[1], since I can do few projects without time limit (for fun) so I did my best to properly program, test and document it. I overcommented on the past but I'm trying to correct it now. Also, all of the new contributors follow the same style so things stay consistent. As an example, let's try to understand the function `.addClass`: - Just to use it you can see the documentation on the website[2], which is the first contact normally. - Then when you try to find the relevant files. They are in github's `src/plugins/addclass`, a name that is common and intuitive [3]. - Not only that, but you also got the documentation in that folder in github thanks to the name `readme.md`. - When opening it [4], the first thing that you note is that the function has a tiny footprint; 8 lines. A brief explanation of what it do
Read the rest
es and a line explaining what the not-so-intuitive function `this.eacharg()` means. - Then we use the native `Element.classList` [5] to add classes. Most people familiar with vanilla javascript know it, but otherwise the name is quite descriptive `el.classList.add(name)` In contrast, while covering quite few other edge cases and older browsers, check jQuery's `.addClass()` code [6]. Or check Zepto.js' `addClass()` code [7] [1] http://github.com/umbrellajs/umbrella/ [2] http://umbrellajs.com/documentation#addclass [3] https://github.com/umbrellajs/umbrella/tree/master/src/plugi... [4] https://github.com/umbrellajs/umbrella/blob/master/src/plugi... [5] https://developer.mozilla.org/en/docs/Web/API/Element/classL... [6] https://github.com/jquery/jquery/blob/305f193aa57014dc7d8fa0... [7] https://github.com/madrobby/zepto/blob/601372ac4e3f98d502c70...
In Ask HN: What are examples of GitHub repositories with high code quality?
Great article! Mislav definitely knows his git. What he didn't point out though is that he was actually the one that contributed that code in the first place. https://github.com/madrobby/zepto/pull/586 https://github.com/madrobby/zepto/commit/3d92f20966aa02dee82... As others have commented, long explanations like this have no place in commit messages. Comments should always be used to explain what you're doing and why you're doing it. Commit messages should simply summarize what you did. A better commit message would have simply been: fix animate() for elements just added to DOM See included comments for explanation.
In Every line of code is always documented
Especially when parts are straight copies out of Zepto. Zepto Closest Implementation: https://github.com/madrobby/zepto/blob/master/src/zepto.js#L... JQ.Mobi: https://github.com/appMobi/jQ.Mobi/blob/master/jq.mobi.js#L3... Zepto End Implementation: https://github.com/madrobby/zepto/blob/master/src/zepto.js#L... JQ.Mobi: https://github.com/appMobi/jQ.Mobi/blob/master/jq.mobi.js#L4... That said, it's all open source and there are only so many ways to write these functions succinctly.
In JQ.Mobi Is A Mobile-Optimized HTML5 Rewrite Of the JQuery Framework
There are a massive number number of features left out - not to mention critical functionality. Just taking a quick peek, for example if we look at .show()/.hide(): http://github.com/madrobby/zepto/blob/master/src/zepto.js#L5... http://github.com/jquery/jquery/blob/master/src/effects.js#L... There is a major case where Zepto's technique just straight-out breaks: If you are showing or hiding anything that isn't a block element. This includes inline elements, table rows, or inline-block elements. There doesn't appear to actually be anyway to unbind an event once you've attached it. Nor any way to detach all handlers of a specific type. There is not a single bug fix for querySelectorAll - this includes the fact that querying from rooted nodes is completely broken for most cases. I can keep going but yeah - there's a world of difference betwe
Read the rest
en Zepto and jQuery. If you're only targeting bleeding-edge WebKit mobile browsers then yeah, Zepto might be fine. However in the jQuery project we take a far more pragmatic view of web development: There are more browsers than just WebKit and the market is much more complex. You can read more about it here: http://jquerymobile.com/strategy/
In Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K (presentation)

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.