<commit_before># KASH

#### Fast and efficient in-memory caching for JavaScript

[![Build Status](https://travis-ci.org/matthewhudson/kash.png?branch=master)](https://travis-ci.org/matthewhudson/kash)

## Benchmarks

<img src="https://i.imgur.com/QIlOZhY.png" />

_Benchmarks run on an early 2013 Macbook Pro: 2.7 GHz Intel Core i7, and 16 GB 1600 MHz DDR3_

## Installation

Using [`npm`](http://npmjs.org/):

``` sh
$ npm [-g] install kash
```

In [Node.js](http://nodejs.org/):

``` javascript
var kash = require("kash");
```
## Usage

``` javascript
setTimeout(function() {
  // Prints "Houdini is... null" to console
  console.log("Houdini is... " + kash.get('houdini'));
}, 101);

kash.set('houdini', 'disappear', 100);

// Prints "disappear" to console
console.log(kash.get('houdini'));
```

### kash.set(key, value [, expires ])

Set a `key` with a `value`. Optionally, pass in a milliseconds `expires` argument.

### kash.get(key)

Retrieve the `value` for the specified `key`. Returns `null` if `key` does not exist.

### kash.del(key)

Deletes a `key`.

### kash.flush()

Removes the cache of all contents.

### kash.size()

Get the number of entries in the cache.

## Author

| [![twitter/matthewgh](http://gravatar.com/avatar/e0f8435a3df533d64b09b8aee394b8d3?s=85)](https://twitter.com/matthewgh "Follow @matthewgh on Twitter") |
|---|
| [<NAME>](http://matthewhudson.me/) |<commit_msg>Clarifying README example code.<commit_after># KASH

#### Fast and efficient in-memory caching for JavaScript

[![Build Status](https://travis-ci.org/matthewhudson/kash.png?branch=master)](https://travis-ci.org/matthewhudson/kash)

## Benchmarks

<img src="https://i.imgur.com/QIlOZhY.png" />

_Benchmarks run on an early 2013 Macbook Pro: 2.7 GHz Intel Core i7, and 16 GB 1600 MHz DDR3_

## Installation

Using [`npm`](http://npmjs.org/):

``` sh
$ npm [-g] install kash
```

In [Node.js](http://nodejs.org/):

``` javascript
var kash = require("kash");
```

## Synopsis

``` javascript
setTimeout(function() {
  console.log(kash.get('foo'));
}, 101);

kash.set('foo', 'bar', 100);

console.log(kash.get('foo'));
```

Will print the following in the console:

``` sh
bar
null
```

## API

### kash.set(key, value [, expires ])

Set a `key` with a `value`. Optionally, pass in a milliseconds `expires` argument.

### kash.get(key)

Retrieve the `value` for the specified `key`. Returns `null` if `key` does not exist.

### kash.del(key)

Deletes a `key`.

### kash.flush()

Removes the cache of all contents.

### kash.size()

Get the number of entries in the cache.

## Author

| [![twitter/matthewgh](http://gravatar.com/avatar/e0f8435a3df533d64b09b8aee394b8d3?s=85)](https://twitter.com/matthewgh "Follow @matthewgh on Twitter") |
|---|
| [<NAME>](http://matthewhudson.me/) |
{'fraction_non_alphanumeric': 0.1897731364782139, 'fraction_numerical': 0.029528267915016206, 'mean_word_length': 4.3526011560693645, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '57011', 'n_tokens_mistral': 1155, 'n_tokens_neox': 1041, 'n_words': 254}