![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
home-or-tmp
Advanced tools
Get the user home directory with fallback to the system temp directory
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.
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.
This package provides a way to get the user's home directory. It is similar to home-or-tmp but does not provide a fallback to a temporary directory if the home directory is not available.
Similar to os-homedir, user-home returns the path to the user's home directory. It does not offer a temporary directory fallback and is therefore less flexible than home-or-tmp when the home directory cannot be determined.
temp-dir is a simple package that provides the path to the system's temporary directory. It is similar to the temporary directory retrieval aspect of home-or-tmp but does not consider the user's home directory.
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.
$ npm install home-or-tmp
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'
FAQs
Get the user home directory with fallback to the system temp directory
The npm package home-or-tmp receives a total of 610,996 weekly downloads. As such, home-or-tmp popularity was classified as popular.
We found that home-or-tmp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.