spagetticoder-helper v1.2.1
Codewonders Helpers here
Codewonders Helpers is a lightweight JavaScript utility library designed to streamline common programming tasks and simplify everyday JavaScript development. This library offers a collection of small, reusable functions that provide solutions to various challenges developers encounter when building web applications and working with JavaScript.
Helper Functions
Array Helpers
copyToClipboard: Gives you the ability to copy a string to the clipboard
formatDate - Gives you the ability to format date in en-us format
getDaysBetweenDates - Gives you a random date in between two given dates
getRandomColor - This return you a random color
getPrimeFactors - This function returns an array of prime factors of a given number.
getPalindrome - This function checks if a given string is a palindrome or not.
getAnagrams - This function returns an array of all possible anagrams of a given string
curry - Currying is a technique that allows you to create a new function by partially applying an existing function. It is useful when you want to reuse a function with different arguments.
memoize - Memoization is a technique that allows you to cache the results of a function so that you can avoid unnecessary computations.
throttle - Throttling is a technique that allows you to limit the rate at which a function can be called. It is useful when you want to prevent a function from being called too frequently.
- debounce - Debouncing is a technique that allows you to delay the execution of a function until after a certain amount of time has passed since the last time it was called. It is useful when you want to prevent a function from being called too frequently
promisify - Promisifying is a technique that allows you to convert a callback-based function into a Promise-based function. It is useful when you want to use modern asynchronous programming techniques with older APIs
traverse - Recursive traversal is a technique that allows you to traverse nested data structures such as trees and graphs using recursion. It is useful when you want to perform operations on every node in the data structure
isEmpty - Gives you the ability to check if any data type is empty
capitalizeFirstLetter - Gives ability to turn first letter for a word into capital letter
getRandomString - Gives you ability to generate random string
start
andend
in an array see more
Still documenting :)
Install
$ npm i spagetticoder-helper
Usage
Getting familiar with the package and you want to use some helper functions like
isEmpty
, isJsonString
,pxToRem
helpers and e.t.c you can easily just
export them the following ways.
import { isEmpty } from 'spagetticoder-helper';