New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

a-split

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

a-split

Split an array into arrays of a specific length

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

a-split

Split an array into arrays of a specific length

Install

$ npm install --save a-split

Example

var split = require('a-split');

console.log(split([1, 2, 3, 4, 5, 6], 2));

// -> [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ] ]

console.log(split([1, 2, 3, 4, 5, 6, 7], 2));

// -> [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ], [ 7 ] ]

require('a-split')(list, length)

Arguments:

  • list: The array to split up
  • length: The maximum amount of items a partial can have

Returns: Returns an array into arrays of a specific length

License

© 2016 Vikram Jadhav. MIT License

Keywords

split

FAQs

Package last updated on 14 Apr 2016

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