Skip to content
Github mirror of "oojs" - our actual code is hosted with Gerrit (please see for contributing
Branch: master
Clone or download
Pull request Compare This branch is 285 commits behind wikimedia:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

OOJS NPM version

OOJS is a JavaScript library for working with objects.

Key features include inheritance, mixins and utilities for working with objects.

/* Example */
( function ( oo ) {
   function Animal() {}
   function Magic() {}
   function Unicorn() { this ); this );
   oo.inheritClass( Unicorn, Animal );
   oo.mixinClass( Unicorn, Magic );
}( OO ) );

Quick start

This module is available as an npm package! Install it right away:

npm install oojs

Or clone the repo, git clone


We use the Semantic Versioning guidelines as much as possible.

Releases will be numbered in the following format:


For more information on SemVer, please visit

Bug tracker

Found a bug? Please report it in the issue tracker!


Release process:

$ cd path/to/oojs/
$ git remote update
  # If you have a fork, be sure to checkout upstream/master or whatever
  # the name of the original remote is.
$ git checkout origin/master
  # Get commits since last version bump
  # Copy the resulting list into a new section on
  # git add -p && git commit -m "history: Add notes for vNEXT" (where NEXT is the next version)
$ git log --format='* %s (%aN)' --no-merges v$(node -e 'console.log(JSON.parse(require("fs").readFileSync("package.json")).version);')...HEAD
  # The following will:
  # - Increase the version number in package.json
  # - Create a commit with message -m (substituting %s for the version)
  # - Create a git tag named "v%s"
$ npm version patch -m 'Tag v%s'
  # Push to the origin
$ git push --tags && git push origin HEAD:master
  # Publish to NPM
  # This will run the prepublish script to re-build dist/oojs.js
$ git checkout v1.2.3
$ npm install && npm test && npm publish
You can’t perform that action at this time.