@small-web/data-home
v1.0.0
Published
The XDG Base Directory Specification data home for Small Technology Foundation projects.
Maintainers
Readme
@small-web/data-home
Paths for storing app data based on the XDG Base Directory Specification as used by Small Technology Foundation’s Small Web projects (Kitten, @small-tech/https, Auto Encrypt, and Auto Encrypt Localhost).
For internal use only.
Exports
dataHomePathFor(env = process.env, homeDirectory = os.homedir()): returns the data home for the given environment.DATA_HOME: the data home of the process environment.SMALL_TECH_DATA_HOME: thesmall-tech.orgdirectory inDATA_HOME.
Usage
e.g.,
import { SMALL_TECH_DATA_HOME } from '@small-web/data-home'Heuristics
The data home is set to, in order:
XDG_DATA_HOMEwhen it exists and is an absolute path. (An empty or relativeXDG_DATA_HOMEis ignored, as required by the specification).When
XDG_DATA_HOMEis not set, the data home is.local/shareunderHOMEWhen
HOMEis not set either,homeDirectory(by defaultos.homedir()).
Like this? Fund us!
Small Technology Foundation is a tiny, independent not-for-profit.
We exist in part thanks to patronage by people like you. If you share our vision and want to support our work, please become a patron or donate to us today and help us continue to exist.
Copyright
Copyright © 2026-present Aral Balkan, Small Technology Foundation.
License
@small-web/data-home is released under AGPL 3.0.
