Skip to content

RafaelFontes/klass-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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
 */

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors