This package has been deprecated

Author message:

array-utility has been moved, Use https://www.npmjs.com/package/arigato.js instead

array-utility

0.0.2 • Public • Published

ArrayUtil v0.0.1

Adds some utility functions to Arrays

Installation

Using NPM:

npm i -g npm
npm i array-utility

Using Yarn:

npm i yarn -g
yarn add array-utility

Examples

Chunk up an Array

require('array-utility'); // Require Array-Utility
const array = ['This', 'is', 'an', 'awesome', 'array']; // The array to chunk
 
console.log(array.chunk(2)); // => [ [ 'This', 'is' ], [ 'an', 'awesome' ], [ 'array' ] ]

Find closest match in an Array

require('array-utility'); // Require Array-Utility
const array = ['This', 'is', 'an', 'awesome', 'array']; // The array to check
 
console.log(array.close('thiss', 3)); // => This

Listing an Array

require('array-utility'); // Require Array-Utility
const array = ['This', 'is', 'an', 'awesome', 'array']; // The array to list
 
console.log(array.list()); // => This, is, an, awesome and array

Trimming an Array

require('array-utility'); // Require Array-Utility
const array = ['This', 'is', 'an', 'awesome', 'array']; // The array to trim
 
console.log(array.trim(2)); // => [ 'This', 'is', '3 more...' ]

If you need any support, feel free to join https://discord.gg/SV7DAE9 You can support the creator at https://patreon.com/wessel

Package Sidebar

Install

npm i array-utility

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

58.6 kB

Total Files

15

Last publish

Collaborators

  • wesselgame