Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A fast, prototypicaly inherited, super-calling constructor-maker
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
test
.gitignore
.npmignore
LICENSE.txt
README.md
package.json 0.0.3
spec.js

README.md

Spec

What

A fast, prototypicaly inherited, super-calling constructor-maker

Why?

Makes protypical inheritance a bit easier.

Usage

require()

var createSpec = require('spec-js');

Make a constructor

function Shape(settings){
    this.sides = settings.sides;
}

Overwrite the identifier with a specd version

Shape = createSpec(Shape);

This creates a specd version of Shape that inherrits from Object.

To inherit from this constructor:

function Square(settings){
    this.sides = 4;
    this.sideLength = settings.sideLength;
}
Something went wrong with that request. Please try again.