node-homedir

Get the effective user's homedir.

MIT 5 个版本
安装
npm install node-homedir
yarn add node-homedir
pnpm add node-homedir
bun add node-homedir
README

node-homedir

Get the effective user's homedir, if Node.js >= v16.0.0 .

Always return the homedir of the current executor, even execute with sudo -u [user] node app.js without -i.

Reference Issue

NPM version CI Test coverage Known Vulnerabilities npm download

Installation

npm install node-homedir

Usage

Commonjs

const { homedir } = require('node-homedir');

console.log(homedir());

ESM & TypeScript

import { homedir } from 'node-homedir';

console.log(homedir());

License

MIT

版本列表
2.0.0 2023-10-05
1.1.1 2018-07-09
1.1.0 2017-10-12
1.0.0 2016-11-04
0.0.1 2016-10-13