array-helps abstracts away the lower level tedium of working with arrays. Whether you want to easily paginate data on the client side or sort collections of data with ease, array-helps will mean writing less code to do it.
The purpose of this project was to clone the popular Lodash library's Array methods and replace much of it's complex code with ES6 features instead. However, many of the array-helps methods currently have poor time complexity and should not be used on large data sets. array-helps is best suited to small front-end projects and dynamic sites that do not handle large amounts of data.
npm install --save array-helper
You can also clone from source if you wish.
git clone [url here later] && mv array-helper [destination]
You can then require the module from index.js in the project root.
Destructure only needed functions:
const { chunk } = require("array-helper") chunk([1, 2, 3, 4, 5, 6, 7, 8], 3) // [[1, 2, 3], [4, 5, 6], [7, 8]]
Or requirethe entire module.
const _ = require("array-helper") _.dropRight(["a", "b", "c"], 2) // ["a"]