JSPM

userhome

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 724673
  • Score
    100M100P100Q181167F
  • License MIT

A cross-platform path to the user's home

Package Exports

  • userhome
  • userhome/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (userhome) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.