Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

userhome

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

userhome - npm Package Compare versions

Comparing version 0.1.0 to 1.0.0

.travis.yml

11

index.js
// userhome
// Copyright (c) 2013 Kyle Robinson Young
// Copyright (c) 2014 Kyle Robinson Young
// Licensed under the MIT license.

@@ -8,5 +8,8 @@

module.exports = function() {
return path.resolve.apply(path.resolve, [
process.env[(process.platform === 'win32') ? 'USERPROFILE' : 'HOME']
].concat(Array.prototype.slice.call(arguments, 0)));
var home = process.env[(process.platform === 'win32') ? 'USERPROFILE' : 'HOME'];
if (!home) {
throw new Error('Could not find a valid user home path.');
}
return path.resolve.apply(path.resolve, [home]
.concat(Array.prototype.slice.call(arguments, 0)));
};
{
"name": "userhome",
"description": "A platform independent path to the user's home",
"version": "0.1.0",
"description": "A cross-platform path to the user's home",
"version": "1.0.0",
"homepage": "https://github.com/shama/userhome",

@@ -11,2 +11,5 @@ "author": {

},
"scripts": {
"test": "node test.js"
},
"repository": {

@@ -27,3 +30,13 @@ "type": "git",

"node": ">= 0.8.0"
},
"keywords": [
"userhome",
"user",
"home",
"homedir",
"path"
],
"devDependencies": {
"tape": "^3.0.0"
}
}

@@ -1,4 +0,4 @@

# userhome
# userhome [![Build Status](http://img.shields.io/travis/shama/userhome.svg)](https://travis-ci.org/shama/userhome)
> A platform independent path to the user's home.
> A cross-platform (OSX, Windows, Linux) path to the user's home.

@@ -13,9 +13,15 @@ ```js

// /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.0 - Throws an error if a user home can not be found.
* 0.1.0 - initial release
## License
Copyright (c) 2013 Kyle Robinson Young
Copyright (c) 2014 Kyle Robinson Young
Licensed under the MIT license.

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc