<commit_before>// (c) <NAME> - http://mais-h.eu/
// License: MIT (http://www.opensource.org/licenses/mit-license.php)

var nano = require('nano');
var when = require('when');
var apply = require('when/apply');

// # CouchDB pagination
//
// [Connect](http://www.senchalabs.org/connect/) middleware for paginated [CouchDB](https://couchdb.apache.org/) views.
// Inspired from [CouchDB guide](http://guide.couchdb.org/draft/recipes.html#pagination), but left the dealbreaker part
// out (expects keys to be unique, either emitted by only one document or reduced).
//
// ## Examples
//
// ### Reduced values
//
// View with both a `map` and a reduce function:
//<commit_msg>Add link to source repository on docs<commit_after>// (c) <NAME> - http://mais-h.eu/
// License: MIT (http://www.opensource.org/licenses/mit-license.php)

var nano = require('nano');
var when = require('when');
var apply = require('when/apply');

// # CouchDB pagination
//
// [Connect](http://www.senchalabs.org/connect/) middleware for paginated [CouchDB](https://couchdb.apache.org/) views.
// Inspired from [CouchDB guide](http://guide.couchdb.org/draft/recipes.html#pagination), but left the dealbreaker part
// out (expects keys to be unique, either emitted by only one document or reduced).
//
// Source [repository](https://github.com/mathbruyen/couchdb-paginate).
//
// ## Examples
//
// ### Reduced values
//
// View with both a `map` and a reduce function:
//
{'fraction_non_alphanumeric': 0.18043025676613464, 'fraction_numerical': 0.0, 'mean_word_length': 3.6818181818181817, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 3, 'lorem ipsum': 0, 'www.': 4, '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': '1928058', 'n_tokens_mistral': 474, 'n_tokens_neox': 464, 'n_words': 126}