<commit_before>jem.js (Javascript Event Manager)
==================================================

This is a Javascipt library which helps us writing event driven Javascript code.
- No dependencies

Fire an event!
===========

#### jem.fire(eventName:string)
###### Fire an event without any attribute. The simplest way of firing an event.

```javascript
jem.fire('MessageSentEvent');

jem.fire('RegistrationCompletedEvent');

jem.fire('MusicStartedEvent');
```

#### jem.fire(eventName:string, attributes:object)
###### Fire an event with specific attributes. Event handlers can use this attributes or you can use those attributes to filter events for a specific handler.

```javascript
jem.fire('MessageSentEvent', { message : 'Hello, World',  messageId : 1312});

jem.fire('RegistrationCompletedEvent', { username : 'sedran', name : 'Serdar', surname : 'Kuzucu' });

jem.fire('MusicStartedEvent', { author : 'Metallica', title : 'Am I Evil?' });
```

#### jem.fire(eventName:string, attributes:object, delay:number)
###### Fire an event with specific attributes after a delay.

```javascript
// Fire event after 15 minutes
jem.fire('TimeIsOverEvent', {}, 15 * 60 * 1000);

jem.fire('MessageSentEvent', { message : 'Hello, World',  messageId : 1312}, 100);

jem.fire('RegistrationCompletedEvent', { username : 'sedran', name : 'Serdar', surname : 'Kuzucu' }, 3000);

// Fire event after the current execution finishes
jem.fire('MusicStartedEvent', { author : 'Metallica', title : 'Am I Evil?' }, 0);
```

#### jem.fire(eventName:string, attributes:object, delay:number, rate:number)
###### Fire an event with specific attributes after a delay with a fixed rate.

```javascript
// Fire event after 15 minutes
// Then fire it again every minute
jem.fire('AddToCartEvent', {}, 15 * 60 * 1000, 60 * 1000);

// Fire event after the current execution finishes
jem.fire('SendAlertEvent', { title : 'Are you still here?' }, 10000, 10000);
```

#### jem.on(eventName:string, callback:function)
###### Attach an event handler for a specific event

```javascript
// Imagine when a new user is registered, 
// you fire UserRegisteredEvent event somewhere in the code
jem.on('UserRegisteredEvent', function (eventName, eventAttributes) {
	// Handle the event
	$(".username").html(eventAttributes.username);
});
```

#### jem.on(eventName:string, filters:object, callback:function)
###### Attach an event handler for a specific event which has specific attributes specified as filters.

```javascript
jem.on('BlogPostedEvent', { category : 'Education' }, function (eventName, eventAttributes) {
	// A blog entry posted by user into the Education category
});
```

#### jem.once(eventName:string, callback:function)
###### Attach a one-time event handler for a specific event.

```javascript
jem.once('BlogPostedEvent', function (eventName, eventAttributes) {
	// A blog entry was posted
	// This code will be called only the first time the event occured.
});
```<commit_msg>trying to create a beautiful readme<commit_after>jem.js (Javascript Event Manager)
==================================================

This is a Javascipt library which helps us writing event driven Javascript code.
- No dependencies

Fire an event!
===========

#### jem.fire(eventName:string)
###### Fire an event without any attribute. The simplest way of firing an event.

```javascript
jem.fire('MessageSentEvent');

jem.fire('RegistrationCompletedEvent');

jem.fire('MusicStartedEvent');
```

#### jem.fire(eventName:string, attributes:object)
###### Fire an event with specific attributes. Event handlers can use this attributes or you can use those attributes to filter events for a specific handler.

```javascript
jem.fire('MessageSentEvent', { message : 'Hello, World',  messageId : 1312});

jem.fire('RegistrationCompletedEvent', { username : 'sedran', name : 'Serdar', surname : 'Kuzucu' });

jem.fire('MusicStartedEvent', { author : 'Metallica', title : 'Am I Evil?' });
```

#### jem.fire(eventName:string, attributes:object, delay:number)
###### Fire an event with specific attributes after a delay.

```javascript
// Fire event after 15 minutes
jem.fire('TimeIsOverEvent', {}, 15 * 60 * 1000);

jem.fire('MessageSentEvent', { message : 'Hello, World',  messageId : 1312}, 100);

jem.fire('RegistrationCompletedEvent', { username : 'sedran', name : 'Serdar', surname : 'Kuzucu' }, 3000);

// Fire event after the current execution finishes
jem.fire('MusicStartedEvent', { author : 'Metallica', title : 'Am I Evil?' }, 0);
```

#### jem.fire(eventName:string, attributes:object, delay:number, rate:number)
###### Fire an event with specific attributes after a delay with a fixed rate.

```javascript
// Fire event after 15 minutes
// Then fire it again every minute
jem.fire('AddToCartEvent', {}, 15 * 60 * 1000, 60 * 1000);

// Fire event after the current execution finishes
jem.fire('SendAlertEvent', { title : 'Are you still here?' }, 10000, 10000);
```


Handle the events!
===========

#### jem.on(eventName:string, callback:function)
###### Attach an event handler for a specific event

```javascript
// Imagine when a new user is registered, 
// you fire UserRegisteredEvent event somewhere in the code
jem.on('UserRegisteredEvent', function (eventName, eventAttributes) {
	// Handle the event
	$(".username").html(eventAttributes.username);
});
```

#### jem.on(eventName:string, filters:object, callback:function)
###### Attach an event handler for a specific event which has specific attributes specified as filters.

```javascript
jem.on('BlogPostedEvent', { category : 'Education' }, function (eventName, eventAttributes) {
	// A blog entry posted by user into the Education category
});
```

#### jem.once(eventName:string, callback:function)
###### Attach a one-time event handler for a specific event.

```javascript
jem.once('BlogPostedEvent', function (eventName, eventAttributes) {
	// A blog entry was posted
	// This code will be called only the first time the event occured.
});
```
{'fraction_non_alphanumeric': 0.16312886511783387, 'fraction_numerical': 0.017382583987965904, 'mean_word_length': 5.406852248394005, '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': '1804179', 'n_tokens_mistral': 1794, 'n_tokens_neox': 1609, 'n_words': 592}