Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
@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 0 weekly downloads. As such, @prisma/get-platform popularity was classified as not 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
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.