<commit_before># redjs
_A redis library for node.js_

```js
Stability: 1 - Experimental
```

#### Features
 - redis unified request protocol
 - requires no external dependencies
 - dead simple api
 - lazy-loading components

#### TODO
 - deeply nested multi bulk replies (e.g. slowlog command)
 - cluster & failover
 - consistent hashing
 - bulk binary data support

## install
```
npm install redjs
```

## example
```js
var client = redjs.createClient();

client.connect(function(err) {
  if (err) {
    return console.log(err.message);
  }

  client.send(['SET', 'keyA', 'listA']);
  client.send(['GET', 'keyA'], function(err, reply) {
    if (err) {
      return console.log(err.message);
    }

    // null is redis way to say: it does not exist.
    if (reply !== null) {
      client.send(['RPUSH', reply, 'some', 'list', 'elements']);
      client.send(['LRANGE', reply, '0', '-1'], function(err, reply) {
        console.log(err, reply);
      });
    }
  });
});

```

## api

### createClient(opt_options)
Create a new client object. `Client` extends `events.EventEmitter`.

The Client is a bare metal network client for redis. It provides only a basic interface for issuing commands, nothing fancy.

`opt_options` contains optional configuration:

```js
{
  host: '127.0.0.1',
  port: 6379,
  reconnect: true,
  maxReconnectCount: 10,
  reconnectInterval: 5000
}
```

#### Event: 'connect'

`function()`

#### Event: 'message'
`function(channel, message)`
<commit_msg>added missing events to README.markdown<commit_after># redjs
_A redis library for node.js_

```js
Stability: 1 - Experimental
```

#### Features
 - redis unified request protocol
 - dead simple api
 - lazy-loading components

#### TODO
 - deeply nested multi bulk replies (e.g. slowlog command)
 - cluster & failover
 - consistent hashing
 - bulk binary data support

## install
```
npm install redjs
```

## example
```js
var client = redjs.createClient();

client.connect(function(err) {
  if (err) {
    return console.log(err.message);
  }

  client.send(['SET', 'keyA', 'listA']);
  client.send(['GET', 'keyA'], function(err, reply) {
    if (err) {
      return console.log(err.message);
    }

    // null is redis way to say: it does not exist.
    if (reply !== null) {
      client.send(['RPUSH', reply, 'some', 'list', 'elements']);
      client.send(['LRANGE', reply, '0', '-1'], function(err, reply) {
        console.log(err, reply);
      });
    }
  });
});

```

## api

### createClient(opt_options)
Create a new client object. `Client` extends `events.EventEmitter`.

The Client is a bare metal network client for redis. It provides only a basic interface for issuing commands, nothing fancy.

`opt_options` contains optional configuration:

```js
{
  host: '127.0.0.1',
  port: 6379,
  reconnect: true,
  maxReconnectCount: 10,
  reconnectInterval: 5000
}
```

#### Event: 'connect'
`function()`

#### Event: 'message'
`function(channel, message)`
#### Event: 'subscribe'
`function(channel, numSubscriptions)`
#### Event: 'unsubscribe'
`function(channel, numSubscriptions)`

{'fraction_non_alphanumeric': 0.16005204944697463, 'fraction_numerical': 0.01236174365647365, 'mean_word_length': 3.7018348623853212, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '7270478', 'n_tokens_mistral': 1023, 'n_tokens_neox': 967, 'n_words': 300}