Very simple & small JS environment check functions.
npm i is-where
Also check out is-what ๐
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
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
Features
isTouchSupported()
Environments
isNode()
isBrowser()
isWebWorker()
isJsDom()
isDeno()
Browsers
isWebKit()
isSafari()
- is-what ๐
- is-where ๐
- merge-anything ๐ฅก
- check-anything ๐
- remove-anything โ๏ธ
- getorset-anything ๐
- map-anything ๐บ
- filter-anything โ๏ธ
- copy-anything ๐ญ
- case-anything ๐ซ
- flatten-anything ๐
- nestify-anything ๐ง
See the full source code here.