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.
A node.js library to get paths to directories to store configs, caches and data according to OS standarts.
npm install appdirsjs
or
yarn install appdirsjs
if you're using yarn.
import appDirs from "appdirsjs";
const dirs = appDirs({ appName: "expo" });
console.log(dirs.cache);
// /home/user/.cache/expo on Linux
// /Users/User/Library/Caches/expo on MacOS
// C:\Users\User\AppData\Local\Temp\expo on Windows
console.log(dirs.config);
// /home/user/.config/expo on Linux
// /Users/User/Library/Preferences/expo on MacOS
// C:\Users\User\AppData\Roaming\expo
console.log(dirs.data);
// /home/user/.local/share/expo on Linux
// /Users/User/Library/Application Support/expo on MacOS
// C:\Users\User\AppData\Local\expo
Then switching from old-style dotfile directory,
such as ~/.myapp
to new, like ~/.config/myapp
,
you can pass legacyPath
parameter
to keep using old directory if it exists:
import * as path from "path";
import appDirs from "appdirsjs";
const dirs = appDirs({
appName: "expo",
// Notice usage of full path
legacyPath: path.join(os.homedir(), ".expo"),
});
console.log(dirs.config);
// /home/user/.expo
FAQs
OS-dependent application paths for cache, data and config directories
The npm package appdirsjs receives a total of 1,530,322 weekly downloads. As such, appdirsjs popularity was classified as popular.
We found that appdirsjs 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.