<commit_before>eventy.js
=========

Simple library for enhancing regular JS objects with event interface. No jQuery and no DOM.
To event enable the type you've just created simply use `eventy.eventEnable( YourObject );`
Let's say you are implementing a car
```
function Car( type ) {
  this.type = type;
}
```
To enable it's events just type
```
eventy.eventEnable( Car );
```
Next you can trigger any event
```
Car.prototype.setType = function ( newType ) {
  if( newType !== this.type ) {
    this.type = newType;
    Car.triggerEvent( 'typeChange', { type: newType } );
  }
};
```
And you can handle any event
```
Car.addEventListener( 'typeChange', function( options ) {
  console.log( options.type );
  console.log( this );
});
```
Just to make sure it works:
```
var car1 = new Car( 'sedan' ),
  car2 = new Car( 'truck' );
  
car1.setType( 'truck' );
car2.setType( 'cabrio' );

```<commit_msg>Added js hilighting to the readme code blocks<commit_after>eventy.js
=========

Simple library for enhancing regular JS objects with event interface. No jQuery and no DOM.
To event enable the type you've just created simply use `eventy.eventEnable( YourObject );`
Let's say you are implementing a car
```javascript
function Car( type ) {
  this.type = type;
}
```
To enable it's events just type
```javascript
eventy.eventEnable( Car );
```
Next you can trigger any event
```javascript
Car.prototype.setType = function ( newType ) {
  if( newType !== this.type ) {
    this.type = newType;
    Car.triggerEvent( 'typeChange', { type: newType } );
  }
};
```
And you can handle any event
```javascript
Car.addEventListener( 'typeChange', function( options ) {
  console.log( options.type );
  console.log( this );
});
```
Just to make sure it works:
```javascript
var car1 = new Car( 'sedan' ),
  car2 = new Car( 'truck' );
  
car1.setType( 'truck' );
car2.setType( 'cabrio' );

```
{'fraction_non_alphanumeric': 0.1478723404255319, 'fraction_numerical': 0.00425531914893617, 'mean_word_length': 4.083783783783784, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3238952', 'n_tokens_mistral': 621, 'n_tokens_neox': 589, 'n_words': 210}