
Research
Malicious npm Package Brand-Squats TanStack to Exfiltrate Environment Variables
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.
app-cache-dir
Advanced tools
Get a path of the standard cache directory for a given application
const appCacheDir = require('app-cache-dir');
// On most Linuxes
appCacheDir('my-app'); //=> '/root/shinnn/.cache/my-app'
// On macOS
appCacheDir('my-app'); //=> '/Users/shinnn/.cache/my-app'
// On Windows
appCacheDir('my-app'); //=> 'C:\\Users\\shinnn\\AppData\\Local\\my-app\\cache'
npm install app-cache-dir
const appCacheDir = require('app-cache-dir');
appName: string (application name)
Return: string (absolute directory path)
It resolves an application name into its standard cache directory presented in the Atom issue tracker, with following the environment variables XDG_CACHE_HOME (POSIX) and LOCALAPPDATA (Windows).
Basically it results:
~/.cache/${appName} on POSIXC:\\Users\\${username}\\AppData\Local\${appName}\cache on Windows// On macOS
appCacheDir('hi'); //=> '/Users/shinnn/.cache/hi'
process.env.XDG_CACHE_HOME = '/foo/bar/';
appCacheDir('hi'); //=> '/foo/bar/hi'
When it cannot resolve the cache path, for exmaple both HOME and XDG_CACHE_HOME are empty, it returns ${os.tmpdir()}/${appName}/cache as a last resort.
appName: string
Return: string
Follow POSIX way regardless of the current OS.
appName: string
Return: string
Follow Windows way regardless of the current OS.
ISC License © 2017 - 2018 Shinnosuke Watanabe
FAQs
Get a path of the standard cache directory for a given application
The npm package app-cache-dir receives a total of 51 weekly downloads. As such, app-cache-dir popularity was classified as not popular.
We found that app-cache-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
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.

Research
Compromised SAP CAP npm packages download and execute unverified binaries, creating urgent supply chain risk for affected developers and CI/CD environments.

Company News
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.