Files
emacs/lisp/emacs-application-framework/app/markdown-previewer/node_modules/userhome/index.js
2022-01-04 15:21:47 +01:00

15 lines
422 B
JavaScript

// userhome
// Copyright (c) 2014 Kyle Robinson Young
// Licensed under the MIT license.
var path = require('path');
module.exports = function() {
var home = process.env[(process.platform === 'win32') ? 'USERPROFILE' : 'HOME'];
if (!home) {
throw new Error('Could not find a valid user home path.');
}
return path.resolve.apply(path.resolve, [home]
.concat(Array.prototype.slice.call(arguments, 0)));
};