Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@prisma/get-platform
Advanced tools
The @prisma/get-platform npm package is a utility library used to detect the platform on which the Node.js process is running. It can identify the operating system and architecture, which is particularly useful for tools that need to download or use platform-specific binaries.
Detecting the platform
This feature allows you to programmatically detect the current platform. The `getPlatform` function returns a promise that resolves to a string indicating the platform, such as 'darwin', 'linux', 'windows', etc.
"require('@prisma/get-platform').getPlatform().then(platform => console.log(platform))"
Detecting the platform synchronously
This feature provides a synchronous way to detect the platform. The `getPlatformSync` function returns a string directly without a promise, which can be useful in scenarios where asynchronous code is not ideal.
"const { getPlatformSync } = require('@prisma/get-platform');
const platform = getPlatformSync();
console.log(platform);"
The 'os' module is a built-in Node.js module that provides operating system-related utility methods. It is similar to @prisma/get-platform in that it can be used to get information about the operating system, but it does not provide as specific platform identifiers for downloading binaries.
The 'detect-libc' package is used to detect the C standard library used on the system (e.g., glibc or musl). It is similar to @prisma/get-platform in that it helps in identifying system-specific characteristics important for binary compatibility, but it focuses on the C library rather than the operating system platform.
The 'systeminformation' package provides detailed information about the system hardware and software. While it offers a broader range of system insights compared to @prisma/get-platform, it is not specifically tailored for identifying platforms for binary downloads.
Platform detection.
⚠️ Warning: This package is intended for Prisma's internal use. Its release cycle does not follow SemVer, which means we might release breaking changes (change APIs, remove functionality) without any prior warning.
If you are using this package, it would be helpful if you could help us gain an understanding where, how and why you are using it. Your feedback will be valuable to us to define a better API. Please share this information at https://github.com/prisma/prisma/discussions/13877 - Thanks!
import { getBinaryTargetForCurrentPlatform } from '@prisma/get-platform'
const binaryTarget = await getBinaryTargetForCurrentPlatform()
FAQs
This package is intended for Prisma's internal use
The npm package @prisma/get-platform receives a total of 2,155,883 weekly downloads. As such, @prisma/get-platform popularity was classified as popular.
We found that @prisma/get-platform demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.