
Security News
Feross on TBPN: Socket's Series C and the State of Software Supply Chain Security
Feross Aboukhadijeh joins TBPN to discuss Socket's $60M Series C, 500%+ ARR growth, AI's impact on open source, and the rise in supply chain attacks.
Go package to get application directories such as config and cache.
| Platform | Linux/BSDs | macOS | Windows |
|---|---|---|---|
| User-specific data | $XDG_DATA_HOME OR $HOME/.local/share | $HOME/Library/Application Support | Unsupported |
| User-specific config | $XDG_CONFIG_HOME OR $HOME/.config | $HOME/Library/Application Support | Unsupported |
| User-specific cache | $XDG_CACHE_HOME OR $HOME/.cache | $HOME/Library/Caches | Unsupported |
| User-specific logs | $XDG_CACHE_HOME OR $HOME/.cache | $HOME/Library/Logs | Unsupported |
| Shared data | $XDG_DATA_DIRS OR /usr/local/share | /Library/Application Support | Unsupported |
| Shared config | $XDG_CONFIG_DIRS OR /etc/xdg | /Library/Application Support | Unsupported |
| Shared cache | /tmp/$(APP)-cache | /Library/Caches | Unsupported |
| Shared logs | $(SHARED_DATA)/logs | /Library/Logs | Unsupported |
Forked from emersion, which got forked from ProtonMail's implemention, which was inspired by configdir.
package main
import (
"os"
"path/filepath"
"xiam.li/appdirs"
)
func main() {
// Get directories for our app
dirs := appdir.New("my-awesome-app")
// Get user-specific config dir
p := dirs.UserConfig()
// Create our app config dir
if err := os.MkdirAll(p, 0755); err != nil {
panic(err)
}
// Now we can use it
f, err := os.Create(filepath.Join(p, "config-file"))
if err != nil {
panic(err)
}
defer f.Close()
f.Write([]byte("<3"))
}
MIT
FAQs
Unknown package
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
Feross Aboukhadijeh joins TBPN to discuss Socket's $60M Series C, 500%+ ARR growth, AI's impact on open source, and the rise in supply chain attacks.

Security News
OSV withdrew 157 OSV malware reports after automated false positives incorrectly flagged trusted npm and PyPI packages, sending bad records into tools that rely on OSV data.

Research
/Security News
TrapDoor crypto stealer hits 36 malicious packages across npm, PyPI, and Crates.io, targeting crypto, DeFi, AI, and security developers.