Utility funcions for web development

Downloads in past


1.0.204 years ago4 years agoMinified + gzip package size for intraactive-framework-utilityfunctions in KB


IntraActive Framework - Utility functions
IntraActive Framework's "Utility functions" package is a collection af convenient js functions used for web development in Sharepoint Modern


``` $ npm install intraactive-framework-utilityfunctions ```


``` import { UtilityFunctions } from 'intraactive-framework-utilityfunctions' ```


``` UtilityFunctions.getSiteCollectionUrl(): string ``` Returning a string value like "" ``` UtilityFunctions.getSiteCollection(): string ``` Returning a string value like "intranet" ``` UtilityFunctions.getCurrentAbsoluteSiteUrl(): string ``` Returning a string value like "" ``` UtilityFunctions.getWebServerRelativeUrl(): string ``` Returning a string value like "/sites/intranet" ``` UtilityFunctions.getLayoutsPageUrl(libraryName: string): string ``` Eg. UtilityFunctions.getLayoutsPageUrl('sp.js') Returning a string value like "/sites/intranet/layouts/15/sp.js" ``` UtilityFunctions.getAbsoluteDomainUrl(): string ``` Returning a string value like "" ``` UtilityFunctions.hexToRgb(hex: string): { r: number; b: number; g: number } ``` Returns the RGB value of a hex-color ``` UtilityFunctions.textColorBasedOnBackgroundColorDarkness(backgroundColor: string, lightReturnColor: string, darkReturnColor: string): string ``` Returns the light or dark color based om darkness of background color ``` UtilityFunctions.getRandomStringKey(): string ``` Returning a random string value ``` UtilityFunctions.getYouTubeThumbnailFromURL(url: string): string ``` Returning the thumpnail image of a valid YouTube URL ``` UtilityFunctions.getTime(date: Date): string ``` Returning the time as a string 'mm:ss'