
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
@bonsai-components/detect-os
Advanced tools
This package aims to make detection of the user's operating system easy.
npm i @bonsai-components/detect-os
There are 3 different variants:
detectOSInBrowser
- handles detection in the browserdetectOSInNodeProcess
- handles detection in nodedetectOS
- universal detection (the most code delivered but handles universal usage)All variants work the same way () => 'mac' | 'windows' | 'other'
. There is a const enum
for typescript users to take advantage of as well.
Common usage:
import { detectOS } from '@bonsai-components/detect-os';
switch (detectOS()) {
case 'mac':
// do something
break;
case 'windows':
// do something
break;
case 'other':
// do something
break;
}
FAQs
Make detecting user's OS less annoying
The npm package @bonsai-components/detect-os receives a total of 147 weekly downloads. As such, @bonsai-components/detect-os popularity was classified as not popular.
We found that @bonsai-components/detect-os demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.