From abd94a7f5a50f43c797a11b53549ae48fff667c3 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 10 Oct 2016 03:43:44 +0200 Subject: add node_modules to address #4364 --- node_modules/user-home/cli.js | 26 +++++++++ node_modules/user-home/index.js | 15 ++++++ node_modules/user-home/license | 21 ++++++++ node_modules/user-home/package.json | 103 ++++++++++++++++++++++++++++++++++++ node_modules/user-home/readme.md | 42 +++++++++++++++ 5 files changed, 207 insertions(+) create mode 100755 node_modules/user-home/cli.js create mode 100644 node_modules/user-home/index.js create mode 100644 node_modules/user-home/license create mode 100644 node_modules/user-home/package.json create mode 100644 node_modules/user-home/readme.md (limited to 'node_modules/user-home') diff --git a/node_modules/user-home/cli.js b/node_modules/user-home/cli.js new file mode 100755 index 000000000..bacbd2275 --- /dev/null +++ b/node_modules/user-home/cli.js @@ -0,0 +1,26 @@ +#!/usr/bin/env node +'use strict'; +var pkg = require('./package.json'); +var userHome = require('./'); + +function help() { + console.log([ + pkg.description, + '', + 'Example', + ' $ user-home', + ' /Users/sindresorhus' + ].join('\n')); +} + +if (process.argv.indexOf('--help') !== -1) { + help(); + return; +} + +if (process.argv.indexOf('--version') !== -1) { + console.log(pkg.version); + return; +} + +process.stdout.write(userHome); diff --git a/node_modules/user-home/index.js b/node_modules/user-home/index.js new file mode 100644 index 000000000..d53b7939a --- /dev/null +++ b/node_modules/user-home/index.js @@ -0,0 +1,15 @@ +'use strict'; +var env = process.env; +var home = env.HOME; +var user = env.LOGNAME || env.USER || env.LNAME || env.USERNAME; + +if (process.platform === 'win32') { + module.exports = env.USERPROFILE || env.HOMEDRIVE + env.HOMEPATH || home || null; +} else if (process.platform === 'darwin') { + module.exports = home || (user ? '/Users/' + user : null) || null; +} else if (process.platform === 'linux') { + module.exports = home || + (user ? (process.getuid() === 0 ? '/root' : '/home/' + user) : null) || null; +} else { + module.exports = home || null; +} diff --git a/node_modules/user-home/license b/node_modules/user-home/license new file mode 100644 index 000000000..654d0bfe9 --- /dev/null +++ b/node_modules/user-home/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/user-home/package.json b/node_modules/user-home/package.json new file mode 100644 index 000000000..6279a8108 --- /dev/null +++ b/node_modules/user-home/package.json @@ -0,0 +1,103 @@ +{ + "_args": [ + [ + { + "raw": "user-home@^1.1.1", + "scope": null, + "escapedName": "user-home", + "name": "user-home", + "rawSpec": "^1.1.1", + "spec": ">=1.1.1 <2.0.0", + "type": "range" + }, + "/home/dold/repos/taler/wallet-webex/node_modules/v8flags" + ] + ], + "_from": "user-home@>=1.1.1 <2.0.0", + "_id": "user-home@1.1.1", + "_inCache": true, + "_location": "/user-home", + "_nodeVersion": "0.10.32", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.1.16", + "_phantomChildren": {}, + "_requested": { + "raw": "user-home@^1.1.1", + "scope": null, + "escapedName": "user-home", + "name": "user-home", + "rawSpec": "^1.1.1", + "spec": ">=1.1.1 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/v8flags" + ], + "_resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz", + "_shasum": "2b5be23a32b63a7c9deb8d0f28d485724a3df190", + "_shrinkwrap": null, + "_spec": "user-home@^1.1.1", + "_where": "/home/dold/repos/taler/wallet-webex/node_modules/v8flags", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "bin": { + "user-home": "cli.js" + }, + "bugs": { + "url": "https://github.com/sindresorhus/user-home/issues" + }, + "dependencies": {}, + "description": "Get the path to the user home directory", + "devDependencies": { + "ava": "0.0.3" + }, + "directories": {}, + "dist": { + "shasum": "2b5be23a32b63a7c9deb8d0f28d485724a3df190", + "tarball": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js", + "cli.js" + ], + "gitHead": "cf6ba885d3e6bf625fb3c15ad0334fa623968481", + "homepage": "https://github.com/sindresorhus/user-home", + "keywords": [ + "cli", + "bin", + "user", + "home", + "homedir", + "dir", + "directory", + "folder", + "path" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "user-home", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/user-home.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.1.1" +} diff --git a/node_modules/user-home/readme.md b/node_modules/user-home/readme.md new file mode 100644 index 000000000..5307a07ef --- /dev/null +++ b/node_modules/user-home/readme.md @@ -0,0 +1,42 @@ +# user-home [![Build Status](https://travis-ci.org/sindresorhus/user-home.svg?branch=master)](https://travis-ci.org/sindresorhus/user-home) + +> Get the path to the user home directory + + +## Install + +```sh +$ npm install --save user-home +``` + + +## Usage + +```js +var userHome = require('user-home'); + +console.log(userHome); +//=> /Users/sindresorhus +``` + +Returns `null` in the unlikely scenario that the home directory can't be found. + + +## CLI + +```sh +$ npm install --global user-home +``` + +```sh +$ user-home --help + +Example + $ user-home + /Users/sindresorhus +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) -- cgit v1.2.3