/usr/lib/nodejs/xdg-basedir/index.js is in node-xdg-basedir 3.0.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | 'use strict';
const os = require('os');
const path = require('path');
const home = os.homedir();
const env = process.env;
exports.data = env.XDG_DATA_HOME ||
(home ? path.join(home, '.local', 'share') : null);
exports.config = env.XDG_CONFIG_HOME ||
(home ? path.join(home, '.config') : null);
exports.cache = env.XDG_CACHE_HOME || (home ? path.join(home, '.cache') : null);
exports.runtime = env.XDG_RUNTIME_DIR || null;
exports.dataDirs = (env.XDG_DATA_DIRS || '/usr/local/share/:/usr/share/').split(':');
if (exports.data) {
exports.dataDirs.unshift(exports.data);
}
exports.configDirs = (env.XDG_CONFIG_DIRS || '/etc/xdg').split(':');
if (exports.config) {
exports.configDirs.unshift(exports.config);
}
|