1.0.2 • Published 3 years ago

manip-array v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

manip-array

Make arrays easier to manipulate! 🦾

npm.io npm.io

Installation

npm i manip-array

Usage

.remove(array, value :int :string)

remove a specific string or index from an array

const manipArray = require('manip-array');

let array = ['foo','bar','foobar']
let foo = manipArray.remove(array, 'bar')
let bar = manipArray.remove(array, 2)

.create(string, {method: 'method'})

create an array from a string.

const manipArray = require('manip-array');

let foo = manipArray.create('testing if this works', {method: 'charachter'})
console.log(foo);
methodsReturns?
whitespacesString split into array without whitespaces
characterAll characters to an array

.compact(array)

removes every empty string and or whitespaces inside of an array.

const manipArray = require('manip-array');

let foo = manipArray.create('testing if this works', {method: 'charachter'});
let bar = manipArray.compact(foo);
console.log(bar);