Socket
Socket
Sign inDemoInstall

os-homedir

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    os-homedir

Node.js 4 `os.homedir()` ponyfill


Version published
Weekly downloads
8.2M
decreased by-1.08%
Maintainers
1
Install size
4.19 kB
Created
Weekly downloads
 

Package description

What is os-homedir?

The os-homedir npm package is a simple utility for getting the home directory of the current user. It is particularly useful in environments where the standard environment variables (like $HOME on Unix-based systems or %USERPROFILE% on Windows) might not be reliably set. It provides a straightforward API to retrieve the user's home directory in a cross-platform way.

What are os-homedir's main functionalities?

Get current user's home directory

This feature allows you to retrieve the home directory of the current user. The function `osHomedir()` returns a string that represents the path to the user's home directory. This is useful for storing user-specific data or configurations outside of your application's directory in a location that is consistent across different operating systems.

const osHomedir = require('os-homedir');
console.log(osHomedir());

Other packages similar to os-homedir

Readme

Source

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

Keywords

FAQs

Last updated on 08 Nov 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc