{
  "author": {
    "name": "Ben Newman",
    "email": "bn@cs.stanford.edu"
  },
  "name": "cls",
  "description": "Class factory featuring inheritance of static properties, static constructors, lazy population of prototypes, and this._super.",
  "keywords": [
    "class",
    "inheritance",
    "static",
    "lazy",
    "super",
    "prototype",
    "extend"
  ],
  "version": "0.1.4",
  "homepage": "http://github.com/benjamn/cls",
  "repository": {
    "type": "git",
    "url": "git://github.com/benjamn/cls.git"
  },
  "main": "main.js",
  "scripts": {
    "test": "node ./node_modules/mocha/bin/mocha --reporter spec"
  },
  "dependencies": {},
  "devDependencies": {
    "mocha": "~1.18.2"
  },
  "engines": {
    "node": ">= 0.6"
  },
  "readme": "Introduction\n---\n\nStandardized `class` syntax\n[is coming](http://wiki.ecmascript.org/doku.php?id=strawman:maximally_minimal_classes)\nin ECMAScript 6, supposedly, but until then I need a class factory that fills the gap.\n\nFor me that means (in no particular order):\n\n* prototypal inheritance under the hood\n* access to overridden properties (`super`)\n* inheritance of `static` properties\n* `static` constructors\n* close correspondence to ES6 syntax\n* ES5/browser compatibility\n* only-pay-for-what-you-use performance\n* excellent test coverage: [![Build Status](https://travis-ci.org/benjamn/cls.png?branch=master)](https://travis-ci.org/benjamn/cls)\n\nI have no delusions of persuading the world to use this tool. Just try\n`npm search inheritance` some time to see how many other people have come\nup with solutions that work for them.\n\nIf you have a special interest in the tired me-too sport of\npure-JavaScript class factory implementations, you might find this one\ninteresting for its solutions to each of the requirements listed above,\nparticularly the lazy (just-in-time) population of prototype properties.\n\nNote that I did not mention privacy enforcement as a requirement. If you\nneed a mechanism like the `private` keyword in other languages, I have a\nseparate [project](https://npmjs.org/package/private) that works\nseamlessly alongside this one.\n\nInstallation\n---\nFrom NPM:\n\n    npm install cls\n\nFrom GitHub:\n\n    cd path/to/node_modules\n    git clone git://github.com/benjamn/cls.git\n    cd cls\n    npm install .\n\nUsage\n---\n\nOne example will have to suffice for now:\n```js\nvar cls = require(\"cls\");\n\nvar BaseClass = cls.extend({\n    init: function(a, b) {\n        this.sum = a + b;\n    },\n\n    getSum: function() {\n        return this.sum;\n    },\n\n    statics: {\n        name: \"BaseClass\",\n\n        init: function(cls) {\n            cls.zero = new cls(0, 0);\n        }\n    }\n});\n\nvar SubClass = BaseClass.extend({\n    init: function(arg) {\n        this._super(arg, arg);\n        this.sum += 1;\n    },\n\n    statics: {\n        name: \"SubClass\"\n    }\n});\n\nassert(BaseClass.name === \"BaseClass\");\nassert(SubClass.name === \"SubClass\");\n\nassert(new BaseClass(2).getSum() === 4);\nassert(new SubClass(2).getSum() === 5);\n\nassert(SubClass.zero !== BaseClass.zero);\nassert(SubClass.zero instanceof SubClass);\nassert(SubClass.zero.getSum() === 1);\n```\nFor more complex examples, see `test/run.js`.\n",
  "readmeFilename": "README.md",
  "bugs": {
    "url": "https://github.com/benjamn/cls/issues"
  },
  "_id": "cls@0.1.4",
  "_shasum": "209e3531edaed42c97107dc7d78c1f86a868a97b",
  "_from": "cls@~0.1.3",
  "_resolved": "https://registry.npmjs.org/cls/-/cls-0.1.4.tgz"
}
