Socket
Socket
Sign inDemoInstall

array-chop

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    array-chop

Split an array into arrays of a specific length


Version published
Maintainers
1
Install size
7.73 kB
Created

Readme

Source

Array-Chop

npm GitHub PRs Welcome tylim88

🐤 Split an array into arrays of a specific length.

✍️ Written in ES6️⃣ and compiled to ES5️⃣.

🦺 Tested.

⛲️ Out of box typescript support.

Installation

npm i array-chop

Usage

import chopArray from 'array-chop'

chopArray(['a', 'b', 'c', 'd', 'e', 'f'], 2)
//=> [['a', 'b'], ['c', 'd'], ['e', 'f']]

chopArray(['a', 'b', 'c', 'd', 'e', 'f', 'foo'], 3)
//=> [['a', 'b', 'c'], ['d', 'e', 'f'], ['foo']]

Acknowledgement

This code repository is replicate of split-array, the core logic, test remain exactly the same. The purpose of this package is to add Typescript support (after failing to contact the original author) and rewrite it with ES6 and Jest.

Keywords

FAQs

Last updated on 28 Jul 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc