# intraactive-framework-utilityfunctions

> Utility funcions for web development

Latest version **1.0.20** (published 2018-10-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install intraactive-framework-utilityfunctions
pnpm add intraactive-framework-utilityfunctions
yarn add intraactive-framework-utilityfunctions
bun add intraactive-framework-utilityfunctions
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.20 |
| Published | 2018-10-22 |
| First published | 2018-06-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 30.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | intraactive team |
| Maintainers | jonasbrink, nielsbrinch_proactive, smukked |
| Keywords | utility functions |

## Links

- npm: https://www.npmjs.com/package/intraactive-framework-utilityfunctions
- npm.io page: https://npm.io/package/intraactive-framework-utilityfunctions

## Dependencies (3)

- [react](https://npm.io/package/react.md) 15.6.2
- [react-dom](https://npm.io/package/react-dom.md) 15.6.2
- [@types/webpack-env](https://npm.io/package/@types/webpack-env.md) >=1.12.1 <1.14.0

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 1.0.20 (latest) — 2018-10-22
- 1.0.19 — 2018-10-22
- 1.0.18 — 2018-10-05
- 1.0.17 — 2018-06-12
- 1.0.16 — 2018-06-12
- 1.0.15 — 2018-06-11
- 1.0.14 — 2018-06-11
- 1.0.13 — 2018-06-11
- 1.0.12 — 2018-06-11
- 1.0.11 — 2018-06-11
- 1.0.10 — 2018-06-11
- 1.0.9 — 2018-06-11
- 1.0.8 — 2018-06-11
- 1.0.7 — 2018-06-11
- 1.0.6 — 2018-06-08
- … 6 more at https://npm.io/package/intraactive-framework-utilityfunctions/versions

## README

# 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'

---
_Source: https://npm.io/package/intraactive-framework-utilityfunctions · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
