This package has been deprecated

Author message:

this package has been superseded by the @xunnamius/next-is-server-side package

is-server-side
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

npm version

is-server-side

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

Package Sidebar

Install

npm i is-server-side

Weekly Downloads

4

Version

1.0.2

License

Unlicense

Unpacked Size

6.82 kB

Total Files

6

Last publish

Collaborators

  • xunnamius