2.0.3 • Published 8 years ago

etho.js v2.0.3

Weekly downloads
3
License
-
Repository
github
Last release
8 years ago

etho.js

Build Status Dependency Status Code Climate Coverage Status stable

NPM

My toolbox, forged to fit my needs, reading the jsjutsu's gurus papers.

Examples

etho.ucfirst

  console.log(etho.ucfirst('foobar'));
  // Print 'Foobar' in the console.

etho.x

Parent class.

var ParentCl = etho.x({
  name: 'ParentCl',
  version: '0.1'
}, function ParentCl(value){
  console.log(this.meta.name, ' constructor !');
  console.log(this.meta);
  return this.init(value);
})({
  'init': function init(value){
    this.value = value;
    console.log(this.meta.name + 'Init !');
  },
  'baz' : function baz(arg){
    console.log(this.meta.name + ':baz this', this);
    return this.meta.name + ' ' + arg + ' ' + this.value + ' Baz'
  }
});

Child class.

var ChildCl = etho.x('ChildCl', ParentCl, function ChildCl(value){
  console.log(this.meta.name, ' constructor !');
  console.log(this.meta);
  this.parentMethod('init')(value);
})({
  'baz' : function baz(){
    return 'Wrapped ' + this.parentMethod('baz')('Bob') + ' Up';
  }
});

In action.

var childCl = new ChildCl('Value that passe everywhere !!!');

console.log(bar.baz());
/** Output in console:
  ChildCl:baz this [Object(instance of ChildCl)]
  Wrapped ChildCl bob Up
**/
2.0.3

8 years ago

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.1.1

9 years ago

0.1.0

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago