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.
unique-temp-dir
Advanced tools
Provides a uniquely named temp directory.
$ npm install --save unique-temp-dir
const uniqueTempDir = require('unique-temp-dir');
uniqueTempDir();
//=> '/var/folders/2_/zg9h6_xd4r3_z7c07s0cn8mw0000gn/T/PpCfz55ANU2hdwnGzgny'
uniqueTempDir();
//=> '/var/folders/2_/zg9h6_xd4r3_z7c07s0cn8mw0000gn/T/qfqafhh1FJulehbCDAPk'
Returns a string that represents a unique directory inside the systems temp directory.
Type: boolean
Default: false
If true
, the directory will be created synchronously before returning.
Type: number
Default: 20
The length of the directory name inside the temp directory.
Type: boolean
Default: false
If true, returns a thunk function for path.join(uniqueTempDir, ... additionalArgs)
. Useful for filling your directory up with stuff.
const uniqueTempDir = require('unique-temp-dir');
const tempDir = uniqueTempDir({thunk: true});
tempDir()
//=> /user/temp/uniqueId
tempDir('foo')
//=> /user/temp/uniqueId/foo
tempDir('bar')
//=> /user/temp/uniqueId/bar
MIT © James Talmage
FAQs
Provides a uniquely named temp directory.
We found that unique-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.
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.