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.
appdata-path
Advanced tools
npm install -S appdata-path
import getAppDataPath from "appdata-path";
// Or
// const getAppDataPath = require("appdata-path");
console.log(getAppDataPath());
/*
* Linux:
* "/home/demurgos/.config"
*
* Mac:
* "/Users/demurgos/Library/Application Support"
*
* Windows:
* "C:\Users\demurgos\AppData\Roaming"
*
* System with custom `APPDATA` environment variable:
* process.env["APPDATA"]
* For example:
* process.env["APPDATA"] = "/home/demurgos/apps"
* => "/home/demurgos/apps"
*/
console.log(getAppDataPath("my-app"));
/*
* Linux:
* "/home/demurgos/.config/my-app"
*
* Mac:
* "/Users/demurgos/Library/Application Support/my-app"
*
* Windows:
* "C:\Users\demurgos\AppData\Roaming\my-app"
*
* System with custom `APPDATA` environment variable:
* path.join(process.env["APPDATA"], "my-app")
* or (if `process.env["APPDATA"] === os.homedir()`)
* path.join(process.env["APPDATA"], ".my-app")
* For example:
* process.env["APPDATA"] = "/home/demurgos/apps"
* => "/home/demurgos/apps/my-app"
* process.env["APPDATA"] = "/home/demurgos"
* => "/home/demurgos/.my-app"
*/
getAppDataPath(app?: string): string
Returns the absolute system-dependant path for the place where applications should store their data for the current user. If you pass the name of your app directory or file as an argument, it will return the absolute path for the place where you should store the data of your application. It will prefix you file / directory name by a dot if the AppData directory happens to also be the user's home, otherwise it will just use it as is. See the examples above.
See CHANGELOG.md.
See LICENSE.md.
FAQs
Get the AppData path
The npm package appdata-path receives a total of 22,888 weekly downloads. As such, appdata-path popularity was classified as popular.
We found that appdata-path 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.