Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.
/ is-server-side Public archive

⛔️ [DEPRECATED] Nanoscopic package that returns true or false depending on if the current runtime is client-side or server-side in an isomorphic application

License

Notifications You must be signed in to change notification settings

Xunnamius/is-server-side

Repository files navigation

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

About

⛔️ [DEPRECATED] Nanoscopic package that returns true or false depending on if the current runtime is client-side or server-side in an isomorphic application

Topics

Resources

License

Stars

Watchers

Forks