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.
cache-directory
Advanced tools
cache-directory
Find the proper cache directory based on operating system
npm install cache-directory
cache-directory
takes one argument, the app name.
var cacheDir = require('cache-directory');
console.log(cacheDir('myApp'));
When run on OS X, cache-directory
assumes it isn't run in a sandboxed process environment. If it is, it will probably break. Additionally, the app name is used instead of the conventional bundle identifier (for simplicity and because many cache-directory
consumers won't necessarily have a bundle identifier).
If a suitable cache directory can't be found, cache-directory
will return null
. You need to handle this case. A reasonable course of action would be to use a temp directory, for which you can use the cache-or-tmp-directory
module.
LGPL 3.0+
Alex Jordan alex@strugee.net
2.0.0 - 2018-03-01
os.homedir()
is used directly instead of a ponyfillFAQs
Find the proper cache directory based on operating system
The npm package cache-directory receives a total of 32,170 weekly downloads. As such, cache-directory popularity was classified as popular.
We found that cache-directory 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.