<commit_before># ![ResSender](http://i.imgur.com/GUhAwKz.jpg)

## ResSendr - Friendly request handlers.

### Installing
    $ npm install ressendr --save

### Using

#### before
```javascript

app.get('/hello',requestHandler)

function requestHandler(req, res){
  res.end('World!')
}
```

#### after
```javascript
import r from 'ressendr'

app.get('/hello',requestHandler)

function requestHandler(req){
  return 'World!';
}
```


##### Using with promises.


#### before
```javascript

app.get('/hello',requestHandler)

function requestHandler(req, res){
  asyncIO.get()
  .then((response)=>{
    res.end(response);
  })
}
```

#### after
```javascript
import r from 'ressendr'

app.get('/hello',r.handle(requestHandler))

function requestHandler(req){
  return asyncIO.get()
}
```<commit_msg>readme fix<commit_after># ![ResSender](http://i.imgur.com/GUhAwKz.jpg)

## ResSendr - Friendly request handlers.

### Installing
    $ npm install ressendr --save

### Using

#### before
```javascript

app.get('/hello',requestHandler)

function requestHandler(req, res){
  res.end('World!')
}
```

#### after
```javascript
import r from 'ressendr'

app.get('/hello',requestHandler)

function requestHandler(req){
  return 'World!';
}
```


##### Using with promises.


#### before
```javascript

app.get('/hello',requestHandler)

function requestHandler(req, res){
  asyncIO.get()
  .then((response)=>{
    res.end(response);
  })
}
```

#### after
```javascript
import r from 'ressendr'

app.get('/hello',r.handle(requestHandler))

function requestHandler(req){
  return asyncIO.get()
}
```



##### Using with promises.Writing yout own handlers :
```javascript
import r from 'ressendr'


//First we need a function that returns true or false
//true if the data can be handlered by the handle.
//so lets write a number Handler

let isNumber = value => !isNaN(value);

//Now we need to handle the value and send it.

let handler = (v,res) => res.end(v.toString());

r.addHandler(isNumber,handler);

app.get('/hello',r.handle(requestHandler))

function requestHandler(req, res){
  return 2
}

```
{'fraction_non_alphanumeric': 0.1814265198659646, 'fraction_numerical': 0.0004786979415988511, 'mean_word_length': 4.633423180592992, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '6212357', 'n_tokens_mistral': 724, 'n_tokens_neox': 681, 'n_words': 169}