mesqueeb / is-where

JS environment check functions like `isWebkit() isSafari() isBrowser() isNode()` etc. A simple & small integration.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

is Where? πŸ™ˆ

Total Downloads Latest Stable Version

Very simple & small JS environment check functions.

npm i is-where

Also check out is-what πŸ™‰

Motivation

I built is-where because I kept Stack Overflowing the same things for every project.

I was looking for:

  • A simple way to check which environment (Node, Browser, Deno, ...)
  • A simple way to check for which browser (WebKit, Safari, Chrome, Firefox, ...)
  • Functions that don't crash when executed in any environment
  • 0 dependencies

Usage

is-where is really easy to use, and most functions work just like you'd expect.

// import functions you want to use like so:
import { isBrowser, isNode, isWebKit } from 'is-where'
isBrowser() // true / false
isNode() // true / false
isWebKit() // true / false

List of functions

Features

  • isTouchSupported()

Environments

  • isNode()
  • isBrowser()
  • isWebWorker()
  • isJsDom()
  • isDeno()

Browsers

  • isWebKit()
  • isSafari()

Meet the family (more tiny utils with TS support)

Source code

See the full source code here.

About

JS environment check functions like `isWebkit() isSafari() isBrowser() isNode()` etc. A simple & small integration.

License:MIT License


Languages

Language:TypeScript 95.3%Language:JavaScript 4.7%