0.1.0 • Published 10 months ago

@dada78641/env-paths v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

TypeScript MIT license npm version

@dada78641/env-paths

Library for determining platform-specific data paths.

This is mainly based on the sindresorhus/env-paths package, with the main difference being that this library will utilize the XDG Base Directory specification even on macOS, if the XDG_*_HOME variables are set.

Usage

npm i @dada78641/env-paths
import {createEnvPaths} from '@dada78641/env-paths'

export const envPaths = createEnvPaths('my_program')

Example output

Running the code as above will return paths such as these:

†: This path will typically be a symlink to someplace else, usually a path starting with /private/var/folders.

XDG variables

The following XDG variables are recognized on Linux and macOS:

VariableKeyDescription
XDG_DATA_HOMEdataData files produced by the application
XDG_CONFIG_HOMEconfigSettings, preferences, etc.
XDG_CACHE_HOMEcacheCache files (should always be deletable)
XDG_STATE_HOMElogSession files, logs, history files, etc.

License

MIT licensed.

0.1.0

10 months ago