lyxaira.glass 74ca844f42 Actualizacion cambios generados: seccion #12, #14 y #15. | 4 年之前 | |
---|---|---|
.. | ||
index.d.ts | 4 年之前 | |
index.js | 4 年之前 | |
license | 4 年之前 | |
package.json | 4 年之前 | |
readme.md | 4 年之前 |
Get XDG Base Directory paths
$ npm install xdg-basedir
const xdgBasedir = require('xdg-basedir');
xdgBasedir.data;
//=> '/home/sindresorhus/.local/share'
xdgBasedir.config;
//=> '/home/sindresorhus/.config'
xdgBasedir.dataDirs
//=> ['/home/sindresorhus/.local/share', '/usr/local/share/', '/usr/share/']
The properties .data
, .config
, .cache
, .runtime
will return null
in the uncommon case that both the XDG environment variable is not set and the users home directory can’t be found. You need to handle this case. A common solution is to fall back to a temp directory.
Directory for user-specific data files.
Directory for user-specific configuration files.
Directory for user-specific non-essential data files.
Directory for user-specific non-essential runtime files and other file objects (such as sockets, named pipes, etc).
Preference-ordered array of base directories to search for data files in addition to .data
.
Preference-ordered array of base directories to search for configuration files in addition to .config
.
MIT © Sindre Sorhus