1. os-homedir
Node.js 4 `os.homedir()` ponyfill
os-homedir
Package: os-homedir
Created by: sindresorhus
Last modified: Fri, 16 Jun 2023 22:44:02 GMT
Version: 2.0.0
License: MIT
Downloads: 34,093,268
Repository: https://github.com/sindresorhus/os-homedir

Install

npm install os-homedir
yarn add os-homedir

Deprecated

This is not needed anymore. Use require('os').homedir() instead.


os-homedir Build Status

Node.js 4 os.homedir() ponyfill

Install

$ npm install --save os-homedir

Usage

 const osHomedir = require('os-homedir');

console.log(osHomedir());
//=> '/Users/sindresorhus'
  • user-home - Same as this module but caches the result
  • home-or-tmp - Get the user home directory with fallback to the system temp directory

License

MIT © Sindre Sorhus

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code