Skip to content
This repository has been archived by the owner on Jan 18, 2019. It is now read-only.
/ ArrayUtil Public archive

Some utility functions that extend JavaScript Arrays

License

Notifications You must be signed in to change notification settings

wesselgame/ArrayUtil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ArrayUtil v0.0.2

npm version 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 or want to request a function, feel free to join https://discord.gg/SV7DAE9

You can support the creator at https://patreon.com/wessel

Releases

No releases published

Packages

No packages published