Nostradamus Prophecy Machine
    Wondering what’s next for npm?Check out our public roadmap! »


    0.25.8 • Public • Published
            ___       _
      ____ |__ \     (_)____
     / __ \__/ /    / / ___/
    / /_/ / __/_   / (__  )    A Coherent Solution
    \____/____(_)_/ /____/  to Your JavaScript Dilemma ;)

    About o2.js

    o2.js is a JavaScript Framework that's constantly evolving with three main goals:

    "In the land of heavy JavaScript libraries, o2.js will be like fresh oxygen ;)."

    o2.js is in still in its growth phase with a pretty stable code base.

    Yet Another JavaScript Framework?! Seriously?

    We have to admit, JavaScript, in its native form is far from being perfect. That's why there are so many frameworks around. Some of these frameworks provide an API or Façade to query, manipulate and animate DOM, while some of these frameworks extend the native JavaScript objects with a bunch of useful functions and methods.

    o2.js is somewhere in the middle. Actually, o2.js is not and end-result. It is a "by-product":

    Up till now, I've used various JavaScript techniques, analyzed and used almost all of the popular JavaScript frameworks, and have built a dozen of JavaScript libraries, from the ground up, myself.

    In that regard, my aim was NOT to develop yet another JavaScript framework. Per contra, my goal was to blog about peculiarities, intricacies, best-practices, patterns, use-cases, implementations of re-usable, cross-platform, optimized JavaScript code at

    As a result, at I dived deep into the realm of JavaScript, trying to seek out library-independent solutions, and sharing my experiences along the way. I still actively blog and continue sharing my knowledge and experience there.

    Ironically enough, while blogging at, I realized that the code snippets that I was mixing together as blog posts were evolving into a solid and re-usable JavaScript framework.

    May the source be with you,


    Hope you like the outcome ;).

    Supported Platforms & User Agents

    o2.js is being designed to run pretty smoothly in almost any device/useragent.

    What makes this possible is the fact that o2.js utilizes modern features whenever possible, while gracefully degrading to slower alternatives for the less capable browsers.

    For instance, o2.js Dom selectors will try to use DOM Level 2 native querySelector method if available, and will fall back to a good-old for loop otherwise.

    o2.js is constantly being developed keeping backwards compatibility in mind. Before each major release, o2.js will be unit-tested in at least the following browsers/platforms:

    • IE7 Windows (and above – o2.js also works on IE6, but it will not be tested)
    • Firefox/Linux (the Most Recent Stable Version)
    • Opera/Linux (the Most Recent Stable Version)
    • Google Chrome/Linux (the Most Recent Stable Version)
    • Firefox/Windows (the Most Recent Stable Version)
    • Opera/Windows (the Most Recent Stable Version)
    • Google Chrome/Windows (the Most Recent Stable Version)
    • Safari/Windows (the Most Recent Stable Version)

    How to Install

    Currently there are no distributable files. But there is an open ticket for those who are interested to create one.

    See also How Do I Contribute section if you are looking for other ways to add value to the project.


    You can directly download the zipball of the recent version, but if you want to contribute:

    is the way to go.

    See Installation and Configuration Instructions for a more in-depth information on how to set up o2.js for local development.

    Older Versions

    Older versions of o2.js are maintained as tagged snapshots for each version.

    A Quick Example

    Here is a quick code sample to give you a feeling of o2.js :

        (function(o2, window, document, undefined) {
            'use strict';
             * Aliases
            var alert = window.alert;
            var on    = o2.Event.addEventListener;
            var ready = o2.ready;
             * Will be executed when DOM is ready.
            ready(function() {
                on(document, 'click', function() {
                    alert('Hello World; Hello Stars; Hello Universe!');
        }(this.o2, this, this.document));

    The above code will show you an alert when you click anywhere on the page.

    You can have a look at the examples/hello-world folder to see the whole code.

    You can also test it on your local environment if you have completed the installation instructions in the previous section.

    Directory Structure

    The directory structure of the project is as follows:

    • 3rdparty: 3rd party components and plugins that are utilized.
    • batch: Documentation, deployment, and configuration scripts.
    • doc: Generated documentation.
    • examples: Sample projects and usage examples (work in progress).
    • o2.js: The o2.js Framework source files.
    • tests: Unit tests (they are being rewritten).
    • What's new in the current version? What development has been done so far?
    • List of people adding value to o2.js. Who else wants to be one of them?
    • Code conventions and best practices for those who want to contribute.
    • Installation and configuration instructions for the development environment.
    • The usual copyright yadda yadda. o2.j2 is is distributed under MIT license, so feel free to fork it.
    • This file that you are currently viewing.
    • The file explaining how to contribute. Please keep in mind that anyone can contribute! And when we say anyone, we mean it ;).

    Where Can I Get Help?

    Here a the places you can get help:

    Where is the Documentation?

    The most up-to-date documentation is under the doc folder of this repository. Other than that you can find a "mostly" recen API documentation at

    Contribution Guidelines

    Bottom Line Up Front:

    o2.js is an open source project, and anyone can contribute. You do not to be a guru, or a ninja, to add value. Heck, you don't even need to know how to code (there are other ways that you can contribute ;)).


    Having said that; make sure you carefully read o2.js Contribution Guidelines before you start.

    Contributors List

    You can look at the contributors list to see the people adding value to o2.js.

    Anyone can be a contributor. Who else wants to learn how to?

    Change Log

    You can view the o2.js Change Log here.


    o2.js is distributed under MIT license. You can play with it however you like.

    See for details.

    Contact Information

    Project Owner: Volkan Özçelik

    Project Website:




    npm i o2

    DownloadsWeekly Downloads






    Last publish


    • avatar