
Research
Node.js Fixes AsyncLocalStorage Crash Bug That Could Take Down Production Servers
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.
platform-utils
Advanced tools
Helper functions for working with platform names in the Node.js vernacular (darwin|win32|linux). Works in Node.js and browsers.
Helper functions for working with platform names in the Node.js vernacular (darwin, win32, linux). Works in Node.js and browsers.
Plays well with the Node.js core modules
os.platform()
and
process.platform.
npm install platform-utils --save
This module exports an object with utility functions.
const {
getPlatformFromFilename,
getPlatformFromUserAgent,
getPlatformLabel
} = require('platform-utils')
getPlatformFromFilename(filename)filename String - e.g. dist/my-cool-app.dmgReturns String darwin, win32, linux, or null.
Here's the gist of how the detection works:
if (ext === 'exe') return 'win32'
if (ext === 'zip' && parts.includes('win32')) return 'win32'
if (ext === 'zip' && parts.includes('windows')) return 'win32'
if (ext === 'zip' && parts.includes('win')) return 'win32'
if (ext === 'zip' && parts.includes('ia32')) return 'win32'
if (ext === 'dmg') return 'darwin'
if (ext === 'pkg') return 'darwin'
if (ext === 'zip' && parts.includes('osx')) return 'darwin'
if (ext === 'zip' && parts.includes('mac')) return 'darwin'
if (ext === 'zip' && parts.includes('macos')) return 'darwin'
if (ext === 'zip' && parts.includes('mas')) return 'darwin'
if (ext === 'zip' && parts.includes('darwin')) return 'darwin'
if (ext === 'rpm') return 'linux'
if (ext === 'deb') return 'linux'
if (ext === 'appimage') return 'linux'
if (ext === 'zip' && parts.includes('linux')) return 'linux'
getPlatformFromUserAgent([agent])agent String (optional) - Can be omitted when used in the browser, where
navigator.userAgent will be used automatically.Returns String darwin, win32, linux, or null.
getPlatformLabel(platform)platform String - Can be darwin, win32, or linux.Returns String macOS, Windows, Linux, or null.
npm install
npm test
MIT
FAQs
Helper functions for working with platform names in the Node.js vernacular (darwin|win32|linux). Works in Node.js and browsers.
The npm package platform-utils receives a total of 372 weekly downloads. As such, platform-utils popularity was classified as not popular.
We found that platform-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Research
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.

Research
/Security News
A malicious Chrome extension steals newly created MEXC API keys, exfiltrates them to Telegram, and enables full account takeover with trading and withdrawal rights.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.