# macos-notification-state **Repository Path**: weenworld/macos-notification-state ## Basic Information - **Project Name**: macos-notification-state - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-01-19 - **Last Updated**: 2022-01-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## macos-notification-state Do you want to check if you should display a notification to your user on macOS? This native module checks if the user is active, if the screen is locked, or if "do not disturb" is enabled. ``` npm install macos-notification-state ``` ``` const { getNotificationState, getSessionState, getDoNotDisturb } = require('macos-notification-state`) // This will brint a boolean (true if enabled, false if not) console.log(getDoNotDisturb()) // This will print a string indiciating the current state, being one of the following: // 'SESSION_SCREEN_IS_LOCKED' // 'SESSION_ON_CONSOLE_KEY' // 'DO_NOT_DISTURB' // 'UNKNOWN' // 'UNKNOWN_ERROR' // // If "do not disturb" is enabled, it takes precedence. console.log(getNotificationState()) // This will print a string indiciating the current session state, being one of the following: // 'SESSION_SCREEN_IS_LOCKED' // 'SESSION_ON_CONSOLE_KEY' // 'UNKNOWN' console.log(getSessionState()) ``` #### License MIT, please see LICENSE for details. Copyright (c) 2019 Felix Rieseberg.