node-homedir
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i node-homedir

Weekly Downloads

42,205

Version

2.0.0

License

MIT

Unpacked Size

8.11 kB

Total Files

10

Last publish

Collaborators

  • ngot
  • fengmk2