Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@uxland/browser-utilities

Package Overview
Dependencies
Maintainers
2
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uxland/browser-utilities

Browser Utilities

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
60
increased by33.33%
Maintainers
2
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 28 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc