npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

o2

v0.25.8

Published

Node.js module export for o2.js JavaScript Framework

Downloads

6

Readme

        ___       _
  ____ |__ \     (_)____
 / __ \__/ /    / / ___/
/ /_/ / __/_   / (__  )    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 http://o2js.com/.

As a result, at http://o2js.com/ 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 http://o2js.com, 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,

Volkan.

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).
  • CHANGELOG.md: What's new in the current version? What development has been done so far?
  • CONTRIBUTORS.md: List of people adding value to o2.js. Who else wants to be one of them?
  • CONVENTIONS.md: Code conventions and best practices for those who want to contribute.
  • INSTALL.md: Installation and configuration instructions for the development environment.
  • LICENSE.md: The usual copyright yadda yadda. o2.j2 is is distributed under MIT license, so feel free to fork it.
  • README.md: This file that you are currently viewing.
  • WE_LOVE_YOU.md: 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 o2js.com/documentation.

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.

License

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

See LICENSE.md for details.

Contact Information

Project Owner: Volkan Özçelik [email protected]

Project Website: http://o2js.com