Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

array-page

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-page

Get a page worth of records from an array

  • 1.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by150%
Maintainers
1
Weekly downloads
 
Created
Source

array-page

Build Status

Get a page worth of records

example

require('array-page').applyPrototype();
var a = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20];

var page = a.page(/*page number*/ 2, /*page size*/ 3);

console.log(page);
// [1,2,3,4,5, _page: { page: 1, size: 5, count: 4, start: 0, stop: 5, first: 1, last: 4, next: 2, previous: null, total : 20 } ]

install

npm install array-page

api

arrayPage = require('array-page')

arrayPage(array, pageNumber, pageSize)

  • array: the array to get a page from
  • pageNumber: the specific page of elements to return
  • pageSize: the number of records to include in the page

arrayPage.applyPrototype()

Add a page method to the Array prototype

arrayPage.defaults(opts);

  • opts:
    • pageSize : numeric; default page size. Default is 20;

license

MIT

Keywords

FAQs

Package last updated on 18 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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