/minified.js

Replace jQuery or MooTools with a <4kB Library

Primary LanguageJavaScript

Minified Web

Quick Links: minifiedjs.com - API - Docs Latest version: beta 3 (changelog)

Overview

Minified.js is a client-side JavaScript library with low footprint (<8kB) and a large feature set. It offers jQuery-like features (DOM manipulation, animation, events, HTTP requests) and utility functions (collections, date&number formatting, date arithmtic, templates) with a simple, coherent API.

Size Comparison

For beta 3:

NameLegacy IE SupportCompiled SizeCompiled and GZip'd
Minifiedno19.1kb8075bytes
...with IE6-8 supportno20.8kb8828 bytes
...Web Module onlyyes9.3kb4075 bytes
...Web Module with IE6-8 supportyes11.1kb4881 bytes
jQuery 1.10.2yes91kb32kb
jQuery 2.0.3no82kb29kb
MooTools Core NoCompat 1.4.5yes88kb29kb
Zepto.js 1.0no27kb9.7kb

Feature Comparison

The goal of Minified is to provide all the basics that you may need on an HTML page.

FeatureMinifiedMinified WebjQueryMooToolsZepto.js
CSS Selectoryes
CSS1 or browser engine
yes
CSS1 or browser engine
yes
CSS3 subset + extensions
yes
CSS3 subset + extensions
yes
browser engine
CSS Style Changesyesyes yes yes yes
CSS Class Changesyesyes yes yes yes
Element Creationyesyes yes
HTML-strings only
yes yes
HTML-strings only
Element Cloningyesyes yes yes yes
DOM Manipulationyesyes yes yes yes
Animation (numeric)yesyes yes yes yes
CSS transitions only
Animation (color)yesyes no yes yes
CSS transitions only
Eventsyesyes yes yes yes
DOMReadyyesyesyesyes yes
Ajax/XHRyesyes yes yes yes
Promises/A+-compatibleyesyes yes no no
JSONyesyes yes yes yes
Cookiesyesyes no yes no
Form Serializationyesyes yes no yes
Collection Helpers yesno yes yes yes
AMD support yesyes yes no no
Templates yesno no no no
Number Formatting yesno no no no
Date Formatting yesno no no no
Date Arithmetic yesno no no no
Online Builder yes
modules and functions
yes
modules and functions
no yes
modules
no
Internet Explorer 6-8 compatible yes
IE-support optional
yes
IE-support optional
yes
jQuery 1.x only
yes no

What you can expect from Minified Web

  • General purpose functions to effectively write HTML-based web applications
  • A very small footprint. The complete distribution will always be smaller than 8kB, and the Web module under 4kb.
  • A clean and simple, easy to use API.
  • A stable API that won't change.

Building

To build Minified, you need to install Node.js and Grunt. Then enter the Minified directory and install the dependencies:

npm install

To build the whole project including the site, use

grunt all

If you only want to compile the code, use

grunt code

Licensing

Public Domain. Use, modify and distribute it any way you like. No attribution required. To the extent possible under law, Tim Jansen has waived all copyright and related or neighboring rights to Minified. Please see http://creativecommons.org/publicdomain/zero/1.0/

About Minified

Call me old-fashioned, but the size of JavaScript libraries like jQuery and MooTools has always bothered me. Don't get me wrong, they are fantastic libraries and I really like to use them, but they contain about 90kb of code even after minification. This code needs to be parsed and executed on every page that you include them on. For me, that just feels too large for what that they offer, and especially for what I need. The 30kb size that they have after gzipping will can also cause a significant delay on low-bandwidth networks.

In the last years I worked on some personal projects (jarfiller.org is the only one that has been published), and when I work on them, I usually strive for perfection. Every unnecessary kilobyte hurts. So instead of using jQuery, I started writing my own little helper functions to replace jQuery functionality without the overhead. As I worked on several other projects, I wrote more and more helper functions and started sharing them between projects until they became a library of their own. By now they are so mature that I believe that this library, called Minified, became a valid alternative to jQuery and MooTools at a fraction of the size.

Thank you for checking out Minified. Tim Jansen