Skip to content

sushidub/jshelprs

Repository files navigation

jshelprs

A set of ESM formatted vanilla Javascript functions (WIP) intended to work with most modern browser api's.


Usage as an ES module:

import { function_name } from '<path to>/jshelprs.js'
import { constant_name } from '<path to>/jshelprs.js'
import { * } from '<path to>/jshelprs.js'

Functions

Array_Difference
Array_Intersection
Array_Unique
Class_Change
Convert_Hex_To_HSL
Convert_Hex_To_RGB
Convert_Odd_To_Even
Convert_RGB_To_HSL
Convert_Transform_To_Matrix
Convert_Unix_Time
Copy_Array_Values
Copy_To_Clipboard
Create_Aspect_Ratio
Create_New_Element
CSS_To_Matrix
DB
Debounce
DOM_Parser
Fetch_HTML_Template
Fetch_Resource
Find_Templates
Fix_This_Float
Format_String
Get_All_Tabbable
Get_Device_Name
Get_File_Format
Get_Last_String_Part
Get_Media_Query_Size
Get_Rando_Num
Get_Window_Size
Is_Divisible
Is_Empty_Object
Iterate
JSON_Prettify
KebabClass
Make_Querable_Promise
Matrix_To_CSS
NodeDevMode
Parse
Parse_String_As_Props
Print_Object_State
Random_Int_Between
Replacer
Report_Error
Reviver
Round_Precision
Set_Styles
Size_To_Text
Sort_By
Storage_Test
Strip
Supports_Popover
To_CamelCase
To_DropCap
To_InitialCaps
Toggle_Fullscreen
Trigger_Event
Type_Exception
TypeOf_Object
Validate_String_As
Wait_For_AnimationEnd
Wait_For_Display
Wait_For_TransitionEnd
Wrangle_Number

Constants

CODES_US_STATES
debug - style console.log statements for easeier visual distinguishment ('at-a-glance')

usage
  // here the `%c` expression initiates the style property: `event` (passed in via the `debug` statement argument)
  console.log('%c Something happened...', debug.event);
  Something happened...
debug property types
  • context properties
    alert: 'font-size:1rem;color:#D35400;'
    args: 'font-size:0.65rem;color:#E67E22;'
    standout: 'font-size:1.5rem;color:yellow;'
    light: 'font-size:0.65rem;color:#94A5A6;'
    small: 'font-size: 0.65rem;'
    large: 'font-size: 1rem;'
    modal: 'color:green;font-size:0.5rem;'
    event: 'font-size: 0.65rem;color:#16A085;'
    ui: 'font-size: 0.65rem;color:#F1C40F;'
    fn: 'font-size:0.65rem;color:#94A5A6;'
    message: 'font-size: 0.65rem;color:#9B59B6;'
    xhr: 'font-size: 0.65rem;color:#F1C40F'
    log: 'font-size: 0.65rem;color: #E67E22;'
  • color properties
    orange: 'color: #E67E22;'
    green: 'color: #2ECC71;'
    yellow: 'color: #F1C40F;'
    red: 'color: #C0392C;'
    purple: 'color: #9B59B6;'
  • object methods
    format: (...props) // where props can be any combination of the context and/or color properties e.g. format('small','orange')

About

A set of useful vanilla Javascript functions in ESM format.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors