Socket
Book a DemoInstallSign in
Socket

is-server-side

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-server-side

⛔️ [DEPRECATED] Quickly determine if code is executing on the client or on the server with SSR/SSG

latest
Source
npmnpm
Version
1.0.3
Version published
Weekly downloads
2
-33.33%
Maintainers
0
Weekly downloads
 
Created
Source

Black Lives Matter! !!UNMAINTAINED!!

⛔️ DEPRECATED/UNMAINTAINED

[!CAUTION]

This package was more a proof-of-concept for publishing a package rather than something super useful. Either way, any useful functionality was merged into next-utils long ago.

This package exports a function that, when called, will tell you if your execution environment is browser-like (e.g. Chrome or Firefox) or server-like (e.g. Node). Useful for Next.js and other fullstack/isomorphic apps.

This package includes TypeScript types and provides:

  • A UMD/CJS/AMD bundle (no tree-shaking)
  • ES2015 modules (tree-shaking)

Install

npm install is-server-side

Usage

import { isServer } from 'is-server-side'

isServer() && doServerStuff();
doOtherStuff();

Contributing

Issues and pull requests are welcome! In lieu of a formal styleguide, take care to maintain the existing coding style.

Add unit tests for any new or changed functionality. Please lint and test your code!

Release History

  • 1.0.x Initial release

Keywords

deprecated

FAQs

Package last updated on 22 Aug 2024

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