Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
The temp-dir npm package provides a simple way to get the path to the system's temporary directory. This can be useful for creating temporary files or directories that you don't need to persist between sessions.
Get Temporary Directory Path
This feature allows you to retrieve the path to the system's temporary directory. This is useful for creating temporary files or directories.
const tempDir = require('temp-dir');
console.log(tempDir);
The os-tmpdir package provides a similar functionality by returning the path of the operating system's default directory for temporary files. It is a lightweight package and can be used as an alternative to temp-dir.
The tmp package offers more advanced functionality for working with temporary files and directories. It can create temporary files and directories, and it also handles cleanup automatically. This makes it more feature-rich compared to temp-dir.
The temp package provides utilities for creating temporary files and directories, similar to tmp. It also includes features for tracking and cleaning up temporary files, making it a more comprehensive solution compared to temp-dir.
Get the real path of the system temp directory
The os.tmpdir()
built-in doesn't return the real path. That can cause problems when the returned path is a symlink, which is the case on macOS. Use this module to get the resolved path.
npm install temp-dir
import temporaryDirectory from 'temp-dir';
console.log(temporaryDirectory);
//=> '/private/var/folders/3x/jf5977fn79jbglr7rk0tq4d00000gn/T'
import os from 'node:os';
console.log(os.tmpdir());
//=> '/var/folders/3x/jf5977fn79jbglr7rk0tq4d00000gn/T' // <= Symlink
FAQs
Get the real path of the system temp directory
The npm package temp-dir receives a total of 10,277,752 weekly downloads. As such, temp-dir popularity was classified as popular.
We found that temp-dir 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.