
Security News
High Salaries No Longer Enough to Attract Top Cybersecurity Talent
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
macos-notification-state
Advanced tools
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())
This package needs to be compiled with at least the macOS 11.0 SDK. If not, the internal operating system info will always return 10.16, rendering the package unusable.
To see the current version, run xcrun --show-sdk-version
.
MIT, please see LICENSE for details. Copyright (c) 2019 Felix Rieseberg.
FAQs
macOS notification state as a native node addon
The npm package macos-notification-state receives a total of 481 weekly downloads. As such, macos-notification-state popularity was classified as not popular.
We found that macos-notification-state demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.
Security News
Corepack will be phased out from future Node.js releases following a TSC vote.