{"id":13404138,"url":"https://github.com/stefangabos/zebrajs","last_synced_at":"2025-12-28T02:33:08.210Z","repository":{"id":12167501,"uuid":"71113682","full_name":"stefangabos/zebrajs","owner":"stefangabos","description":"A modular, jQuery compatible, ultra light-weight JavaScript micro-library for modern browsers","archived":false,"fork":false,"pushed_at":"2024-06-25T10:21:35.000Z","size":1990,"stargazers_count":31,"open_issues_count":0,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-20T13:07:06.209Z","etag":null,"topics":["dom","javascript","javascript-micro-library","selector-engine"],"latest_commit_sha":null,"homepage":"https://stefangabos.github.io/zebrajs/download/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stefangabos.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"stefangabos","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2016-10-17T07:59:09.000Z","updated_at":"2024-12-28T13:42:31.000Z","dependencies_parsed_at":"2023-02-18T14:45:34.204Z","dependency_job_id":null,"html_url":"https://github.com/stefangabos/zebrajs","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefangabos%2Fzebrajs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefangabos%2Fzebrajs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefangabos%2Fzebrajs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefangabos%2Fzebrajs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stefangabos","download_url":"https://codeload.github.com/stefangabos/zebrajs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245489756,"owners_count":20623789,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dom","javascript","javascript-micro-library","selector-engine"],"created_at":"2024-07-30T19:01:39.601Z","updated_at":"2025-12-28T02:33:08.203Z","avatar_url":"https://github.com/stefangabos.png","language":"JavaScript","funding_links":["https://github.com/sponsors/stefangabos","https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=9563UHJR67EVE"],"categories":["JavaScript"],"sub_categories":[],"readme":"\u003cimg src=\"https://raw.githubusercontent.com/stefangabos/zebrajs/master/docs/images/logo.png\" alt=\"zebrajs\" align=\"right\"\u003e\n\n# ZebraJS \u0026nbsp;[![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=A+modular,+jQuery+compatible,+ultra+light-weight+JavaScript+micro-library+for+modern+browsers\u0026url=https://github.com/stefangabos/zebrajs\u0026via=stefangabos\u0026hashtags=jquery,javascript)\n\n*A modular, jQuery compatible, ultra light-weight JavaScript micro-library for modern browsers*\n\n[![npm](https://img.shields.io/npm/v/@stefangabos/zebra_js)](https://www.npmjs.com/package/@stefangabos/zebra_js) [![Total](https://img.shields.io/npm/dt/@stefangabos/zebra_js)](https://www.npmjs.com/package/@stefangabos/zebra_js) [![Monthly](https://img.shields.io/npm/dm/@stefangabos/zebra_js)](https://www.npmjs.com/package/@stefangabos/zebra_js) [![](https://data.jsdelivr.com/v1/package/npm/@stefangabos/zebra_js/badge)](https://www.jsdelivr.com/package/npm/@stefangabos/zebra_js) [![License](https://img.shields.io/npm/l/@stefangabos/zebra_js)](https://github.com/stefangabos/@stefangabos/zebra_js/blob/master/LICENSE.md)\n\n**ZebraJS** is a truly modular, jQuery-compatible, ultra-lightweight (**~20Kb minified, ~7Kb gzipped**) JavaScript micro-library designed for modern browsers. It brings the familiar, intuitive syntax of jQuery to the modern web while leveraging native browser capabilities for superior performance and a dramatically smaller footprint.\n\nIn today's web development landscape, browsers have converged on standards and natively support many features that jQuery pioneered. However, writing vanilla JavaScript for DOM manipulation remains verbose and repetitive. ZebraJS bridges this gap perfectly - offering jQuery's developer-friendly API powered by modern, efficient native browser methods.\n\n## :zap: Why ZebraJS?\n\n### Lightweight \u0026 Modular\n- **Drastically smaller** than jQuery - full library is only ~20Kb minified (~7Kb gzipped)\n- **Truly modular** - build custom versions with only the methods you need via the [online builder](https://stefangabos.github.io/zebrajs/download/)\n- **Tree-shakeable** when used with modern bundlers\n- Perfect for projects where jQuery is overkill but vanilla JS is too verbose\n\n### jQuery-Compatible Syntax\n- **Familiar API** - if you know jQuery, you know ZebraJS\n- **Drop-in replacement** for many common jQuery use cases\n- **Easy migration** from jQuery projects without rewriting your code\n- Retains the intuitive chaining and selector syntax developers love\n\n### Modern \u0026 Performant\n- **Native browser APIs** under the hood for optimal performance\n- **Modern ES6+ syntax** - leverages arrow functions, template literals, and other modern JavaScript features\n- Built for **modern browsers** without legacy baggage\n- Leverages **querySelector/querySelectorAll** for fast, standards-based DOM selection\n- Clean, maintainable codebase inspired by [You Don't Need jQuery](https://github.com/oneuijs/You-Dont-Need-jQuery)\n\n### Production-Ready\n- **Well-documented** with comprehensive API documentation\n- **Actively maintained** with regular updates\n- **NPM package** available for easy integration\n- **CDN-hosted** via JSDelivr for quick prototyping\n\n## :notebook_with_decorative_cover: Documentation\n\nCheck out the [awesome documentation](https://stefangabos.github.io/zebrajs/index.html)!\n\n## :floppy_disk: Custom build\n\nBuild a [customized version](https://stefangabos.github.io/zebrajs/download/) of the library and include just the bits you need\n\n## 🎂 Support the development of this project\n\nYour support means a lot and it keeps me motivated to keep working on open source projects.\u003cbr\u003e\nIf you like this project please ⭐ it by clicking on the star button at the top of the page.\u003cbr\u003e\nIf you are feeling generous, you can buy me a coffee by donating through PayPal, or you can become a sponsor.\u003cbr\u003e\nEither way - **Thank you!** 🎉\n\n[\u003cimg src=\"https://img.shields.io/github/stars/stefangabos/zebrajs?color=green\u0026label=star%20it%20on%20GitHub\" width=\"132\" height=\"20\" alt=\"Star it on GitHub\"\u003e](https://github.com/stefangabos/zebrajs) [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=9563UHJR67EVE) [\u003cimg src=\"https://img.shields.io/badge/-Sponsor-fafbfc?logo=GitHub%20Sponsors\"\u003e](https://github.com/sponsors/stefangabos)\n\n## Installation\n\nDownload the [full library](https://github.com/stefangabos/zebrajs/archive/master.zip) from GitHub (and use either `dist/zebra.min.js` or `/dist/zebra.src.js`), or go on and [get your customized version](https://stefangabos.github.io/zebrajs/download/).\n\nzebraJS is also available as a [npm package](https://www.npmjs.com/package/@stefangabos/zebra_js). To install it use:\n\n```bash\n# the \"--save\" argument adds the plugin as a dependency in packages.json\nnpm install @stefangabos/zebra_js --save\n```\n\nAlternatively, you can load zebraJS from [JSDelivr CDN](https://www.jsdelivr.com/package/npm/zebra_transform) like this:\n```html\n\u003c!-- for the most recent version, not recommended in production --\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/@stefangabos/zebra_js@latest/dist/zebra.min.js\"\u003e\u003c/script\u003e\n\n\u003c!-- for a specific version --\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/@stefangabos/zebra_js@1.0.2/dist/zebra.min.js\"\u003e\u003c/script\u003e\n\n\u003c!-- replacing \"min\" with \"src\" will serve you the non-compressed version --\u003e\n```\n\n## Examples\n\nThe most important thing this library does, similarly to jQuery, is to simplify the process of selecting DOM elements by providing a unified wrapper for JavaScript's [querySelector](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector), [querySelectorAll](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll) and [getElementById](https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementById) via a shorthand function called, by default, `$` (dollar sign) and which can be renamed to whatever character or string allowed by JavaScript.\n\n```javascript\n// always cache selectors\n// to avoid scanning the DOM over and over again\nvar elements = $('selector')\n```\n\nAs with both querySelector and querySelectorAll, the `selector` string may contain one or more CSS selectors separated by commas:\n\n```javascript\nvar elements = $('div.authentication .form-container.authentication input[type=text]');\n```\n\n\u003e I cannot stress enough how important it is to understand the fact that **everytime** you call the **$** global function you will create a new object that will take up memory - ZebraJS does not cache selectors! Therefore, you should **never** use it in an event handler or a function that gets called multiple times over the lifetime of a page and instead **cache those selectors outside those functions!** Yes, this true for jQuery, also.\n\nOnce you grab hold of one or more elements (we call this *wrapping elements* because we *wrap* the ZebraJS object over the selected elements) you can call any of [ZebraJS's methods](https://stefangabos.github.io/zebrajs/index.html).\n\n## Where to use ZebraJS\n\nI use this to fuel my (small) pet projects where jQuery is overkill and plain JavaScript is too verbose. Also, more often than not, I just need very little from jQuery, and hence the modular approach.\n\nKeep in mind that this library is currently work-in-progress so adjust your expectations accordingly.\n\n## Contributing\n\nMake sure you have installed [Node.js, npm](https://docs.npmjs.com/getting-started/installing-node) and [Grunt](http://gruntjs.com/). Once you have those, open up a terminal in the project's folder and run `npm install`. Next time you'll just have to type `grunt` in your terminal while in the project's folder.\n\nFrom this point on, when you edit the project's files in the `/src` folder, Grunt will automatically run tasks that will check whether you follow the project's coding standards via [ESLint](http://eslint.org/docs/about/), will do static code analysis via [JSHint](http://jshint.com/about/), will use [Uglify](https://github.com/mishoo/UglifyJS) on the code and will generate the documentation with [JSDoc](https://github.com/jsdoc3/jsdoc) (documentation follows JavaDoc standards)\n\nYou can help by writing actual code for the methods listed in the `/src` folder and which don't have yet been written. The methods are included in the main `$.js` file via comments looking like `// import \"methodName.js\"`.\n\nAlternatively, you can help improving the library's website in the `/docs/download` folder. This implies altering JavaScript and CSS files in the `/docs/download/assets_src` folder and the actual `index.html` in `/docs/download`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefangabos%2Fzebrajs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstefangabos%2Fzebrajs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefangabos%2Fzebrajs/lists"}