Socket
Socket
Sign inDemoInstall

pagination-template

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pagination-template - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

1

lib/pagination.js

@@ -38,2 +38,3 @@ /**

index: 1 //if the number of page
}

@@ -40,0 +41,0 @@ **/

2

package.json
{
"name": "pagination-template",
"version": "0.1.2",
"version": "0.1.3",
"description": "Pagination of results for use in a template",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -6,18 +6,54 @@ pagination-template

#Install
##Install
npm install pagination-template
npm install pagination-template
#Use
##Use
var pagination = require('pagination-template');
var paginator = new pagination('search', 3, 141, 13);
var result = paginator.getPagination();
var pagination = require('pagination-template');
var paginator = new pagination('search', 3, 141, 13);
var result = paginator.getPagination();
The value of variable result in this example is:
[ { url: 'search/1/13',
actualPage: false,
index: 1 },
{ url: 'search/2/13',
actualPage: false,
index: 2 },
{ url: 'search/3/13',
actualPage: true,
index: 3 },
{ url: 'search/4/13',
actualPage: false,
index: 4 },
{ url: 'search/5/13',
actualPage: false,
index: 5 },
{ url: 'search/6/13',
actualPage: false,
index: 6 },
{ url: 'search/7/13',
actualPage: false,
index: 7 },
{ url: 'search/8/13',
actualPage: false,
index: 8 },
{ url: 'search/9/13',
actualPage: false,
index: 9 },
{ url: 'search/10/13',
actualPage: false,
index: 10 },
{ url: 'search/11/13',
actualPage: false,
index: 11 } ]
##Use with Express
res.render('index', {
pagination : result
});
res.render('index', {
pagination : result
});

@@ -27,1 +63,23 @@

##Parameters
You can send optional parameters to the constructor for more customization
Example:
var parameters = {
maxPagination : 10,
showBeginingEnd: true,
domain: 'http://www.google.com',
};
var paginator = new pagination('search', 3, 141, 13, parameters);
###maxPagination
Maximum number of indexes show. If for example we have a 20 pages and the maxPagination value is 10 the result is and the actual pages is 7 the result is 4 5 6 7 8 9 10 11 12 13
###showBeginingEnd
Check if they have to show the scroll buttons start end
###domain
If this options is passed then the url will be the concatenation of domain and the urlOrigin
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc