Socket
Socket
Sign inDemoInstall

pedash

Package Overview
Dependencies
0
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    pedash

A lodash-like javascript helper -- for dummies


Version published
Maintainers
1
Install size
4.42 kB
Created

Readme

Source

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!"

Keywords

FAQs

Last updated on 11 Feb 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc