<commit_before>## pagination

Pagination for javascript/nodejs

## usage example

	var pagination = require('pagination');
	var paginator = pagination.create('search', {prelink:'/', current: 1, rowsPerPage: 200, totalResult: 10020});
	console.log(paginator.render());

### OR

	var pagination = require('pagination');
	var paginator = new pagination.SearchPaginator({prelink:'/', current: 1, rowsPerPage: 200, totalResult: 10020});
	console.log(paginator.render());

### OR 

	var pagination = require('pagination');
	var paginator = new pagination.ItemPaginator({prelink:'/', current: 3, rowsPerPage: 200, totalResult: 10020});
	console.log(paginator.render());
	
	// output (without newlines)
	<div class="paginator">
		<span class="paginator-current-report">Results 401 - 600 of 10020</span>
		<a href="/?page=1" class="paginator-first">First</a>
		<a href="/?page=2" class="paginator-previous">Previous</a>
		<a href="/?page=4" class="paginator-next">Next</a>
		<a href="/?page=51" class="paginator-last">Last</a>
	</div>

### OR need data from the calculation

	var pagination = require('pagination');
	var paginator = new pagination.SearchPaginator({prelink:'/', current: 3, rowsPerPage: 200, totalResult: 10020});
	console.log(paginator.getPaginationData());
	
	// output
	{ prelink: '/',
	  current: 3,
	  previous: 2,
	  next: 4,
	  first: 1,
	  last: 51,
	  range: [ 1, 2, 3, 4, 5 ],
	  fromResult: 401,
	  toResult: 600,
	  totalResult: 10020,
	  pageCount: 51 }
	  
<commit_msg>Adding doc for available options<commit_after>## pagination

Pagination for javascript/nodejs

## usage example

	var pagination = require('pagination');
	var paginator = pagination.create('search', {prelink:'/', current: 1, rowsPerPage: 200, totalResult: 10020});
	console.log(paginator.render());

### OR

	var pagination = require('pagination');
	var paginator = new pagination.SearchPaginator({prelink:'/', current: 1, rowsPerPage: 200, totalResult: 10020});
	console.log(paginator.render());

### OR 

	var pagination = require('pagination');
	var paginator = new pagination.ItemPaginator({prelink:'/', current: 3, rowsPerPage: 200, totalResult: 10020});
	console.log(paginator.render());
	
	// output (without newlines)
	<div class="paginator">
		<span class="paginator-current-report">Results 401 - 600 of 10020</span>
		<a href="/?page=1" class="paginator-first">First</a>
		<a href="/?page=2" class="paginator-previous">Previous</a>
		<a href="/?page=4" class="paginator-next">Next</a>
		<a href="/?page=51" class="paginator-last">Last</a>
	</div>

### OR need data from the calculation

	var pagination = require('pagination');
	var paginator = new pagination.SearchPaginator({prelink:'/', current: 3, rowsPerPage: 200, totalResult: 10020});
	console.log(paginator.getPaginationData());
	
	// output
	{ prelink: '/',
	  current: 3,
	  previous: 2,
	  next: 4,
	  first: 1,
	  last: 51,
	  range: [ 1, 2, 3, 4, 5 ],
	  fromResult: 401,
	  toResult: 600,
	  totalResult: 10020,
	  pageCount: 51 }
	  
## Options

totalResult: {Integer}
==========
Number of total items in result set
	
prelink: {Integer}
==========
Link to append the page-param

rowsPerPage: {Integer}
==========
Number of items per page, default to 10

pageLinks: {Integer}
==========
Number of links to create in page range, default to 5

current: {Integer}
==========
Indicate which page is the current one. Page always starts with 1.

translator: {Function}
==========
For translations of FIRST, NEXT, ... Simple example

	var translations = {
		'PREVIOUS' : 'Voorgaand',
		'NEXT' : 'Volgende',
		'FIRST' : 'Eerst',
		'LAST' : 'Laatste',
		'CURRENT_PAGE_REPORT' : 'Resulten {FromResult} - {ToResult} van {TotalResult}'
	};
	
	var item = new ItemPaginator({
		prelink : '/',
		pageLinks : 5,
		current : 5,
		totalResult : 100,
		translator : function(str) {
			return translations[str];
		}
	});
{'fraction_non_alphanumeric': 0.17313664596273293, 'fraction_numerical': 0.041666666666666664, 'mean_word_length': 4.667155425219941, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '4054921', 'n_tokens_mistral': 1495, 'n_tokens_neox': 1290, 'n_words': 340}