Icontem

klass.js: Create classes with support to annotations

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (7)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2013-12-16 (1 year ago) RSS 2.0 feedNot enough user ratingsTotal: 130 All time: 309 This week: 84Up
Version License JavaScript version Categories  
klass-js 1.0.0GNU General Publi...1.0Data types, Node.js
Description Author  

This object can create classes with support to annotations.

It can create classes with static, public and private methods and variables.

It also supports annotations that are extracted from comments in the class definition code.

Innovation Award  
JavaScript Programming Innovation award nominee
December 2013
Number 3
The JavaScript object model is different of other languages which are class based.

This object can be used to define classes in JavaScript like in other languages with support to static, public and private methods and properties, as well for additional metadata in annotation comments.

Manuel Lemos
Picture of Rafael Lúcio
Name: Rafael Lúcio <contact>
Classes: 11 packages by
Country: Brazil Brazil
Age: 27
All time rank: 41 in Brazil Brazil
Week rank: 17 Down2 in Brazil Brazil Down
Innovation award
Innovation award
Nominee: 3x

Details provided by the author  
### klassjs


It's a simple way to create classes with static, public and private methods/variables with the support of annotations.

### Example

All the files are under the example folder

```javascript
require ('../klass.js');
require ('./helloworld.js');
require ('./annotations/action.js');

var hw = new HelloWorld();
    hw.sayHi('poste9')
      .sayHello();

for(var key in hw)
{
    if (hw[key].hasAnnotation(Action))
    {
        console.log(key + " is an action!")
    }
    else
    {
        console.log(key + " is not an action!")
    }
}

/**
 * Expected out:
 Hi poste9
 Hello poste9
 sayHi is an action!
 sayHello is not an action!

 Process finished with exit code 0
 */
 ```
  Files folder image Files  
File Role Description
Files folder imageexample (2 files, 1 directory)
Plain text file klass.js Class Class source
Plain text file package.json Data Auxiliary data
Plain text file readme.md Data Auxiliary data

  Files folder image Files  /  example  
File Role Description
Files folder imageannotations (2 files)
  Plain text file helloworld.js Example Example script
  Plain text file test.js Example Example script

  Files folder image Files  /  example  /  annotations  
File Role Description
  Plain text file action.js Example Example script
  Plain text file annotation.js Example Example script

 Version Control Unique User Downloads Download Rankings  
 100%Total:130All time:309
 This week:0This week:84Up