Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@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 used for Prisma 2 binaries.
import { getPlatform } from '@prisma/get-platform'
const platform = await getPlatform()
FAQs
This package is intended for Prisma's internal use
The npm package @prisma/get-platform receives a total of 1,341,594 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.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.