oojs

Power for object oriented javascript libraries.

npm install oojs
26 downloads in the last week
34 downloads in the last month

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() {
        Animal.call( this );
        Magic.call( 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 https://git.wikimedia.org/git/oojs/core.git.

Versioning

We use the Semantic Versioning guidelines as much as possible.

Releases will be numbered in the following format:

<major>.<minor>.<patch>

For more information on SemVer, please visit http://semver.org/.

Bug tracker

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

Release

Release process:

$ cd path/to/oojs/
$ git remote update
$ git checkout -b release -t origin/master

# Ensure tests pass
$ npm install && npm test

# Avoid using "npm version patch" because that creates
# both a commit and a tag, and we shouldn't tag until after
# the commit is merged.

# Update release notes
# Copy the resulting list into a new section on History.md
$ git log --format='* %s (%aN)' --no-merges v$(node -e 'console.log(JSON.parse(require("fs").readFileSync("package.json")).version);')...HEAD
$ edit History.md

# Update the version number
$ edit package.json

$ git add -p
$ git commit -m "Tag vX.X.X"
$ git review

# After merging:
$ git remote update
$ git checkout origin/master
$ git tag "vX.X.X"
$ git push --tags
$ npm publish
npm loves you