1.0.2 • Published 2 years ago

@uxland/browser-utilities v1.0.2

Weekly downloads
-
License
BSD-4-Clause
Repository
github
Last release
2 years ago

UXL Browser Utilities npm version

Build StatusStatementsBranchesFunctionsLines
BuildStatusStatementsBranchesFunctionsLines

Installation

npm i @uxland/browser-utilities

Usage

Get browser's language

Returns language depending on user's navigator languages

getBrowserLang(); //=> 'ca'

Meta

Display's meta information such as browser version, UA, LitElement version

displayMetaInformation();

Layout sizing

Display's layout sizing

displayLayoutSizing(true);

Convert file to base64

const file = new File(["foo"], "foo.txt", {
  type: "text/plain",
});
await toBase64(file); //=> data:text/plain;base64,Zm9v

Browser's device

Returns true depending on device type

isTabletBrowser(); //=> true | false
isMobileBrowser(); //=> true | false
isMobileOrTabletBrowser(); //=> true | false

Animation frame

Asynchronous task that will call provided callback in next window animation frame

const callback = () => console.log("task ended");
const handler = animationFrame.run(callback); //=> 'task ended'
// To cancel asynchronous task
animationFrame.cancel(handler);

Asynchronous queue

Creates an asynchronous queue instance that will call provided function when possible

const executor = (...args: any[]) => console.log("Queue Executor", args);
const queue = new AsyncQueue(executor);
queue.enqueueItem(1); //=> 'Queue Executor' 1;

Debouncer

https://polymer-library.polymer-project.org/3.0/api/utils/debounce

Idle Period

Micro task

https://polymer-library.polymer-project.org/3.0/api/utils/async

Time out

https://polymer-library.polymer-project.org/3.0/api/utils/async

1.0.2

2 years ago

1.0.1

2 years ago

1.0.1-alpha.25

2 years ago

1.0.1-alpha.24

2 years ago

1.0.1-alpha.23

2 years ago

1.0.1-alpha.21

3 years ago

1.0.1-alpha.20

3 years ago

1.0.1-alpha.15

3 years ago

1.0.1-alpha.14

3 years ago

1.0.1-alpha.13

3 years ago

1.0.1-alpha.19

3 years ago

1.0.1-alpha.18

3 years ago

1.0.1-alpha.17

3 years ago

1.0.1-alpha.16

3 years ago

1.0.1-alpha.12

3 years ago

1.0.1-alpha.11

3 years ago

1.0.1-alpha.9

3 years ago

1.0.1-alpha.8

3 years ago

1.0.1-alpha.10

3 years ago

1.0.1-alpha.7

3 years ago

1.0.1-alpha.6

3 years ago

1.0.1-alpha.5

3 years ago

1.0.1-alpha.4

3 years ago

1.0.1-alpha.3

3 years ago

1.0.1-alpha.2

3 years ago

1.0.1-alpha.1

3 years ago

1.0.1-alpha.0

3 years ago

1.0.0

3 years ago

1.0.0-alpha.4

3 years ago

1.0.0-alpha.3

3 years ago

1.0.0-alpha.2

3 years ago

1.0.0-alpha.1

3 years ago

1.0.0-alpha.0

3 years ago