Socket
Socket
Sign inDemoInstall

home-or-tmp

Package Overview
Dependencies
2
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    home-or-tmp

Get the user home directory with fallback to the system temp directory


Version published
Maintainers
1
Install size
11.6 kB
Created

Package description

What is home-or-tmp?

The home-or-tmp npm package is a simple utility that provides a way to get the user's home directory or, if that's not available, a temporary directory. It is useful for applications that need to store or manage files in a user-specific or temporary location without having to worry about platform differences.

What are home-or-tmp's main functionalities?

Get user's home directory or temporary directory

This feature allows you to retrieve a path to the user's home directory or a fallback temporary directory. It abstracts away the differences between operating systems and the availability of environment variables.

const homeOrTmp = require('home-or-tmp');
console.log(homeOrTmp); // Outputs the user's home directory or a temporary directory if the home directory is not available.

Other packages similar to home-or-tmp

Readme

Source

home-or-tmp Build Status

Get the user home directory with fallback to the system temp directory

Useful in cases where the home directory either isn't set or doesn't exist.

Install

$ npm install --save home-or-tmp

Usage

var homeOrTmp = require('home-or-tmp');

console.log(homeOrTmp);
//=> '/Users/sindresorhus'

// and if there's no home directory:

console.log(homeOrTmp);
//=> '/var/folders/m3/5574nnhn0yj488ccryqr7tc80000gn/T'

License

MIT © Sindre Sorhus

Keywords

FAQs

Last updated on 17 May 2015

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