https://github.com/hurricaneinteractive/in-browser-env
https://github.com/hurricaneinteractive/in-browser-env
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hurricaneinteractive/in-browser-env
- Owner: HurricaneInteractive
- License: mit
- Created: 2019-11-12T21:57:31.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T08:43:46.000Z (over 3 years ago)
- Last Synced: 2025-02-22T10:36:39.674Z (over 1 year ago)
- Language: TypeScript
- Size: 3.71 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: code-of-conduct.md
Awesome Lists containing this project
README
# inBrowserEnv
> Uses this [repo](https://github.com/alexjoverm/typescript-library-starter.git) as a base.
inBrowserEnv is a way to check if a process is running in node or in the browser. This is useful when using frameworks like Nextjs or GatsbyJS.
## Usage
### Install
```bash
npm i in-browser-env --save
yarn add in-browser-env
```
### In Code
```js
import inBrowserEnv from "in-browser-env"
if (isBrowserEnv()) {
// in a browser environment
}
```