Socket
Socket
Sign inDemoInstall

home-or-tmp

Package Overview
Dependencies
0
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
Weekly downloads
1,712,396
decreased by-9.8%

Weekly downloads

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

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 home-or-tmp

Usage

import homeOrTemp from 'home-or-tmp';

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

// And if there is no home directory:

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

Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Keywords

FAQs

Last updated on 16 Apr 2021

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