intraactive-sdk-helper
TypeScript icon, indicating that this package has built-in type declarations

1.2.117 • 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'

Readme

Keywords

Package Sidebar

Install

npm i intraactive-sdk-helper

Weekly Downloads

106

Version

1.2.117

License

MIT

Unpacked Size

388 kB

Total Files

5

Last publish

Collaborators

  • douglasromaoproactive
  • ama_proactive