Skip to content

Latest commit

 

History

History
54 lines (41 loc) · 1.52 KB

README.md

File metadata and controls

54 lines (41 loc) · 1.52 KB

Abstractly Utilities

A collection of tiny JavaScript utilities

  1. camelize

    • Converts string to camelCase.
    • Example: camelize("hello world") // "helloWorld"
  2. getAvgColorOfImg

    • Calculates average image color.
    • Example: getAvgColorOfImg(imageElement) // e.g., "#7f8c8d"
  3. Update getAvgColorOfImg

    • Updated average color calculation.
    • Example: getAvgColorOfImg(newImageElement) // e.g., "#bdc3c7"
  4. getMonthNameFromDateString

    • Extracts month name from date.
    • Example: getMonthNameFromDateString("2023-12-18") // "December"
  5. getMonthNumberFromMonthName

    • Gets month number from name.
    • Example: getMonthNumberFromMonthName("March") // 3
  6. getOS

    • Identifies operating system.
    • Example: getOS() // e.g., "Windows"
  7. getSystemInfo

    • Retrieves system information.
    • Example: getSystemInfo() // { os: "Linux", browser: "Firefox", ... }
  8. isDev

    • Checks development environment.
    • Example: isDev() // true or false
  9. isEven

    • Checks if number is even.
    • Example: isEven(4) // true
  10. isOdd

    • Checks if number is odd.
    • Example: isOdd(5) // true
  11. isTodayOrFuture

    • Checks if date is today/future.
    • Example: isTodayOrFuture("2023-12-18") // true or false
  12. shadeColor

    • Adjusts color shade.
    • Example: shadeColor("#ff5733", -20) // Darker color
  13. slugify

    • Creates URL-friendly slug.
    • Example: slugify("Hello World!") // "hello-world"