# fl_helper

> Vanilla ES6 helper collection

Latest version **1.6.5** (published 2019-01-16) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install fl_helper
pnpm add fl_helper
yarn add fl_helper
bun add fl_helper
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.6.5 |
| Published | 2019-01-16 |
| First published | 2018-11-27 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 12.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | fvellerts |
| Maintainers | fvonellerts |
| Keywords | helper |

## Links

- npm: https://www.npmjs.com/package/fl_helper
- Repository: -
- npm.io page: https://npm.io/package/fl_helper

## Dependencies (1)

- [smoothscroll-polyfill](https://npm.io/package/smoothscroll-polyfill.md) ^0.4.3

## 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.6.5 (latest) — 2019-01-16
- 1.6.4 — 2019-01-16
- 1.6.3 — 2019-01-16
- 1.6.2 — 2019-01-16
- 1.6.1 — 2019-01-16
- 1.6.0 — 2019-01-16
- 1.5.2 — 2019-01-15
- 1.5.1 — 2019-01-08
- 1.5.0 — 2019-01-08
- 1.4.1 — 2019-01-08
- 1.4.0 — 2019-01-07
- 1.3.2 — 2019-01-07
- 1.3.1 — 2019-01-07
- 1.3.0 — 2019-01-07
- 1.2.0 — 2019-01-04
- … 3 more at https://npm.io/package/fl_helper/versions

## README

# fl_helper
Vanilla ES6 helper collection

``npm install fl_helper``

## Usage

``import * as flHelper from 'fl_helper'``

Add `import 'babel-polyfill'` if IE11 support is needed.

## Functions

### Checks

#### isEmpty
Detects if a value is truly empty ('', undefined or null). If emptyOutput contains a value, it will be returned if the original value is empty.
```javascript
flHelper.isEmpty(value, emptyOutput = false)
```

#### detectIE
Detects Internet Explorer (any version).
```javascript
flHelper.detectIE()
```

#### detectMobile
Detects mobile devices (screen width under 767px).
```javascript
flHelper.detectMobile()
```

### Listeners

#### onScroll
High performance and nonblocking scroll listener.
```javascript
flHelper.onScroll(scrollTop => {}, container = window)
```

### Extensions

#### objectAssignDeep
Performs a deep merge (merge with multiple dimensions) of objects and returns a new object.
Useful for extending function options.
```javascript
flHelper.objectAssignDeep(...objects)
```

#### scrollIntoViewCenter
Cross-browser function to center an element in the viewport. Also runs the smoothscroll polyfill. The default centerPosition is half the screen height.
```javascript
flHelper.scrollIntoViewCenter(element, smooth = true, centerPosition = window.innerHeight >> 1)
```

#### outerHeight
Returns the element height including margins.
```javascript
flHelper.outerHeight(element)
```

### File handlers

#### uploadText
Creates a file upload dialog and returns text in promise.
```javascript
flHelper.uploadText(type = 'application/json').then(text => {})
```

#### downloadText
Downloads text string as a file.
```javascript
flHelper.downloadText(text, name, type = 'application/json')
```

### Polyfills

#### [smoothscroll](http://iamdustan.com/smoothscroll/)
Polyfills window.scroll functions.
```javascript
flHelper.polyfillSmoothScroll()
```

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