Skip to content
/ userhome Public

🏠 A platform independent path to the user's home.

License

Notifications You must be signed in to change notification settings

shama/userhome

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

userhome

A cross-platform (OSX, Windows, Linux) path to the user's home.

var userhome = require('userhome');

console.log(userhome('.bashrc'));
// /Users/shama/.bashrc

console.log(userhome('test', 'sub', 'file'));
// /Users/shama/test/sub/file

console.log(userhome());
// C:\Users\shama

If a valid user home environment variable could not be found an error will be thrown indicating so.

Release History

  • 1.0.1 - Fix license in package.json.
  • 1.0.0 - Throws an error if a user home can not be found.
  • 0.1.0 - initial release

License

Copyright (c) 2024 Kyle Robinson Young
Licensed under the MIT license.

About

🏠 A platform independent path to the user's home.

Resources

License

Stars

Watchers

Forks

Packages

No packages published