Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

intraactive-framework-utilityfunctions

1.0.20 • Public • Published

IntraActive Framework - Utility functions

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

Installation

$ npm install intraactive-framework-utilityfunctions

Import

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

Usage

UtilityFunctions.getSiteCollectionUrl(): string

Returning a string value like "https://domain.sharepoint.com/sites/intranet"

UtilityFunctions.getSiteCollection(): string

Returning a string value like "intranet"

UtilityFunctions.getCurrentAbsoluteSiteUrl(): string

Returning a string value like "https://domain.sharepoint.com/sites/intranet/subsite/Pages/Home.aspx"

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 "https://domain.sharepoint.com"

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'

Install

npm i intraactive-framework-utilityfunctions

DownloadsWeekly Downloads

407

Version

1.0.20

License

MIT

Unpacked Size

31 kB

Total Files

6

Last publish

Collaborators

  • avatar
  • avatar
  • avatar