Pedash 🌶
A simple Javascript utilities library to ease your daily development routines. You can think of it as a mini-lodash.
Anyway, pedash means spicy in Bahasa Indonesia, literally. 🌶🥵🥵
How to use
Install
npm install pedash
or yarn add pedash
Import it somewhere in your app
import { getLongest } from pedash;
// Then use it whatever you like
const foods = ["Pizza", "Lasagna", "Karedok", "Banana split", "Rendang", "Souffle"];
console.log(getLongest(foods));
// "Banana split"
Available methods
getCharCountsByKey(arr: any[])
// Example
randomId()
// Example
getLongest(arr: any[], key?: string)
// Example
getUnique(arr: any[])
// Example
groupByKey(arr: any[], key?: string)
// Example
getHighest(arr: any[], key?: string)
// Example
shuffle(arr: any[])
import { shuffle } from pedash;
// Then use it whatever you like
const numbers = [56, 89, 21, 20, 7];
console.log(shuffle(numbers));
// [20, 21, 7, 89, 56]
removeDoubleWords(sentence: string)
import { removeDoubleWords } from pedash;
// Then use it whatever you like
const sentence = "You you can do it now now"
console.log(removeDoubleWords(sentence));
// "You can do it now"
removeWhitespaces(sentence: string)
import { removeWhitespaces } from pedash;
// Then use it whatever you like
const sentence = " You you can do it now or never "
console.log(removeWhitespaces(sentence));
// "You can do it now or never"
stripTags(htmlString: string)
import { stripTags } from pedash;
// Then use it whatever you like
const tags = "<p><em>Hello</em> <strong>world!</strong></p>"
console.log(stripTags(tags));
// "Hello world!"