Socket
Book a DemoInstallSign in
Socket

github.com/chasinglogic/appdirs

Package Overview
Dependencies
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/chasinglogic/appdirs

Source
Go
Version
v0.0.0-20240910093348-1aea124d8cd9
Version published
Created
Source

appdirs

Go Reference CI

This is a port of the excellent python module named the same, which can be found here appdirs (now deprecated and replaced by platformdirs).

The original port was written by wessie this is a maintained fork of that project.

The Problem

When writing desktop application, finding the right location to store user data and configuration varies per platform. Even for single-platform apps, there may by plenty of nuances in figuring out the right location.

For example, if running on macOS, you should use

~/Library/Application Support/<AppName>

If on Windows (at least English Win) that should be::

C:\Documents and Settings\<User>\Application Data\Local Settings\<AppAuthor>\<AppName>

or possibly::

C:\Documents and Settings\<User>\Application Data\<AppAuthor>\<AppName>

for roaming profiles but that is another story.

On Linux (and other Unices), according to the XDG Basedir Spec, it should be

~/.local/share/<AppName>

appdirs to the rescue

This library provides a simple to use API to get the appropriate storage directories no matter the platform and what you want to store.

FAQs

Package last updated on 10 Sep 2024

Did you know?

Socket

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.

Install

Related posts