<commit_before># mantafs

`mantafs` provides an API for interacting with
[Joyent Manta](http://www.joyent.com/products/manta)that is drop-in compatible
with node's [fs](http://nodejs.org/api/fs.html) API.  This API automatically
manages interactions with Manta by maintaining a local on-disk cache; this will
give you a dramatic performance increase (since in most cases the WAN is
avoided), at the cost of no longer being consistent at any point in time with
your data in Manta (i.e., this is 'A' in CAP).

# Usage

As always:

    npm install mantafs

Then to use:

```javascript
var assert = require('assert');
var manta = require('manta');
var mantafs = require('mantafs');

var fs = mantafs.createClient({
    files: 10000,                // how many local files to keep
    path: '/var/tmp/mantafs',    // where to stash cached files
    sizeMB: 1000,                // how much disk space to consume
    ttl: 3600,                   // if no cache-control header, the default TTL
    manta: manta.createClient({  // must provide a Manta client
        sign: manta.privateKeySigner({
            key: fs.readFileSync(process.env.HOME + '/.ssh/id_rsa', 'utf8'),
            keyId: process.env.MANTA_KEY_ID,
            user: process.env.MANTA_USER
        }),
        user: process.env.MANTA_USER,
        url: process.env.MANTA_URL
    })
});

fs.readdir('~~/stor', function (err, files) {
    assert.ifError(err);
    console.log(files);
    fs.close();
});

```<commit_msg>[minor] README update<commit_after># mantafs

`mantafs` provides an API for interacting with
[Joyent Manta](http://www.joyent.com/products/manta)that is drop-in compatible
with node's [fs](http://nodejs.org/api/fs.html) API.  This API automatically
manages interactions with Manta by maintaining a local on-disk cache; this will
give you a dramatic performance increase (since in most cases the WAN is
avoided), at the cost of no longer being consistent at any point in time with
your data in Manta (i.e., this is 'A' in CAP).

# Usage

As always:

    npm install mantafs

Then to use:

```javascript
var assert = require('assert');
var manta = require('manta');
var mantafs = require('mantafs');

var fs = mantafs.createClient({
    files: 10000,                // how many local files to keep
    path: '/var/tmp/mantafs',    // where to stash cached files
    sizeMB: 1000,                // how much disk space to consume
    ttl: 3600,                   // if no cache-control header, the default TTL
    manta: manta.createClient({  // must provide a Manta client
        sign: manta.privateKeySigner({
            key: fs.readFileSync(process.env.HOME + '/.ssh/id_rsa', 'utf8'),
            keyId: process.env.MANTA_KEY_ID,
            user: process.env.MANTA_USER
        }),
        user: process.env.MANTA_USER,
        url: process.env.MANTA_URL
    })
});


fs.once('ready', function () {
    fs.readdir('~~/stor', function (err, files) {
        assert.ifError(err);

        console.log(files);

        fs.close(function (err2) {
            assert.ifError(err2);
            manta.close();
        });
    });
});

```
{'fraction_non_alphanumeric': 0.11906290115532735, 'fraction_numerical': 0.009627727856225931, 'mean_word_length': 2.6371061843640606, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1104033', 'n_tokens_mistral': 1022, 'n_tokens_neox': 964, 'n_words': 313}