Check if the application is running as a PWA
First, install the library in your project by npm:
$ npm install check-is-pwaOr Yarn:
$ yarn add check-is-pwaConnect the library to the project with ES6 import:
import checkIsPwa from 'check-is-pwa';Or CommonJS:
const checkIsPwa = require('check-is-pwa');Next use library:
const status = checkIsPwa();//the app is running as a PWA
checkIsPwa(); // true// the app is NOT running as a PWA / is running in the SSR
checkIsPwa(); // falseThanks goes to these wonderful people (emoji key):
Jakub Biesiada 💻 |
This project follows the all-contributors specification. Contributions of any kind welcome!
This project is licensed under the MIT License © 2020-present Jakub Biesiada