All Projects â†’ stefangabos â†’ zebrajs

stefangabos / zebrajs

Licence: other
A modular, jQuery compatible, ultra light-weight JavaScript micro-library for modern browsers

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to zebrajs

phantom
ðŸ‘ŧ A reactive DOM rendering engine for building UIs.
Stars: ✭ 16 (-38.46%)
Mutual labels:  dom
CDom
Simple HTML/XML/BBCode DOM component for PHP.
Stars: ✭ 26 (+0%)
Mutual labels:  dom
rottenjs
An all-in-one (2.6kb) Javascript library for web development
Stars: ✭ 15 (-42.31%)
Mutual labels:  dom
recks
ðŸķ React-like RxJS-based framework
Stars: ✭ 133 (+411.54%)
Mutual labels:  dom
object-dom
HTML Object Declarative Dom
Stars: ✭ 20 (-23.08%)
Mutual labels:  dom
sapa
sapa is a library that creates a UI with a simple event system.
Stars: ✭ 65 (+150%)
Mutual labels:  dom
parsed-html-rewriter
A DOM-based implementation of Cloudflare Worker's HTMLRewriter.
Stars: ✭ 34 (+30.77%)
Mutual labels:  dom
theBookOfNoah
Everything ive learned developing web applications
Stars: ✭ 22 (-15.38%)
Mutual labels:  dom
hsx
Static HTML sites with JSX and webpack (no React).
Stars: ✭ 15 (-42.31%)
Mutual labels:  dom
foliage
🍃 Style your components with performance
Stars: ✭ 29 (+11.54%)
Mutual labels:  dom
front-end-notes
前įŦŊčŊūįĻ‹å­Ķäđ įŽ”čŪ°æą‡æ€ŧ
Stars: ✭ 57 (+119.23%)
Mutual labels:  dom
anim8js
The ultimate animation library for javascript - animate everything!
Stars: ✭ 33 (+26.92%)
Mutual labels:  dom
rem
An HTML parsing library, written in Zig.
Stars: ✭ 56 (+115.38%)
Mutual labels:  dom
zig-wasm-dom
Zig + WebAssembly + JS + DOM
Stars: ✭ 81 (+211.54%)
Mutual labels:  dom
zero-drag
Minimal abstraction of DOM drag-and-drop interactions
Stars: ✭ 17 (-34.62%)
Mutual labels:  dom
attoparser
A tiny but fast java event-style markup parser.
Stars: ✭ 46 (+76.92%)
Mutual labels:  dom
paginathing
a jQuery plugin to paginate your DOM easily.
Stars: ✭ 23 (-11.54%)
Mutual labels:  dom
cheatsheets
📋 Various cheatsheets made while working as a developer
Stars: ✭ 22 (-15.38%)
Mutual labels:  dom
vanilla-jsx
Vanilla jsx without runtime. HTML Tag return DOM in js, No virtual DOM.
Stars: ✭ 70 (+169.23%)
Mutual labels:  dom
react-append-to-body
React Higher order component that allows you to attach components to the DOM outside of the main app.
Stars: ✭ 30 (+15.38%)
Mutual labels:  dom

zebrajs

ZebraJS  Tweet

A modular, jQuery compatible, ultra light-weight JavaScript micro-library for modern browsers

npm Total Monthly License

A truly modular, jQuery compatible, ultra-lightweight (13Kb minified, 4Kb gzipped), JavaScript micro-library for modern browsers (IE 10+) meant to simplify the interaction with the DOM in the post-jQuery world, now that there are there are less and less differences between how browsers handle various JavaScript-related aspects and offer native support for most of the things that jQuery had to tackle and take care for us, behind the scenes, since its first release back in 2006.

Nevertheless, the need for a library to handle common tasks needed when interacting with the DOM becomes obvious for anyone writing JavaScript on a daily basis, as there's quite some code to write to handle various aspects of DOM manipulation.

ZebraJS retains jQuery's intuitive and simple syntax but the code behind is largely inspired from the excellent You Don't Need jQuery GitHub repository as well as the documentation on Mozilla Developer Network, and makes use of the modern browsers' improved support for manipulating DOM elements. Also, in line with the modern age's pursuit for byte saving, ZebraJS allows you to build customized versions of the library and include just the bits you need.

📔 Documentation

Check out the awesome documentation!

ðŸ’ū Custom build

Build a customized version of the library and include just the bits you need

🎂 Support the development of this project

Your support means a lot and it keeps me motivated to keep working on open source projects.
If you like this project please ⭐ it by clicking on the star button at the top of the page.
If you are feeling generous, you can buy me a coffee by donating through PayPal, or you can become a sponsor.
Either way - Thank you! 🎉

Star it on GitHub Donate

Installation

Download the full library from GitHub (and use either dist/zebra.min.js or /dist/zebra.src.js), or go on and get your customized version.

zebraJS is also available as a npm package. To install it use:

# the "--save" argument adds the plugin as a dependency in packages.json
npm install @stefangabos/zebra_js --save

Alternatively, you can load zebraJS from JSDelivr CDN like this:

<!-- for the most recent version, not recommended in production -->
<script src="https://cdn.jsdelivr.net/npm/@stefangabos/zebra_js@latest/dist/zebra.min.js"></script>

<!-- for a specific version -->
<script src="https://cdn.jsdelivr.net/npm/@stefangabos/[email protected]/dist/zebra.min.js"></script>

<!-- replacing "min" with "src" will serve you the non-compressed version -->

Examples

The 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, querySelectorAll and getElementById via a shorthand function called, by default, $ (dollar sign) and which can be renamed to whatever character or string allowed by JavaScript.

// always cache selectors
// to avoid scanning the DOM over and over again
var elements = $('selector')

As with both querySelector and querySelectorAll, the selector string may contain one or more CSS selectors separated by commas:

var elements = $('div.authentication .form-container.authentication input[type=text]');

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.

Once 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.

Where to use ZebraJS

I 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.

Keep in mind that this library is currently in its infancy so adjust your expectations accordingly.

Contributing

Make sure you have installed Node.js, npm and Grunt. 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.

From 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, will do static code analysis via JSHint, will use Uglify on the code and will generate the documentation with JSDoc (documentation follows JavaDoc standards)

You 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".

Alternatively, 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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].