diff options
Diffstat (limited to 'tools/eslint/node_modules/user-home')
-rwxr-xr-x | tools/eslint/node_modules/user-home/cli.js | 26 | ||||
-rw-r--r-- | tools/eslint/node_modules/user-home/index.js | 15 | ||||
-rw-r--r-- | tools/eslint/node_modules/user-home/license | 21 | ||||
-rw-r--r-- | tools/eslint/node_modules/user-home/package.json | 69 | ||||
-rw-r--r-- | tools/eslint/node_modules/user-home/readme.md | 42 |
5 files changed, 173 insertions, 0 deletions
diff --git a/tools/eslint/node_modules/user-home/cli.js b/tools/eslint/node_modules/user-home/cli.js new file mode 100755 index 0000000000..bacbd22755 --- /dev/null +++ b/tools/eslint/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/tools/eslint/node_modules/user-home/index.js b/tools/eslint/node_modules/user-home/index.js new file mode 100644 index 0000000000..d53b7939ae --- /dev/null +++ b/tools/eslint/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/tools/eslint/node_modules/user-home/license b/tools/eslint/node_modules/user-home/license new file mode 100644 index 0000000000..654d0bfe94 --- /dev/null +++ b/tools/eslint/node_modules/user-home/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (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/tools/eslint/node_modules/user-home/package.json b/tools/eslint/node_modules/user-home/package.json new file mode 100644 index 0000000000..8b9e8b4854 --- /dev/null +++ b/tools/eslint/node_modules/user-home/package.json @@ -0,0 +1,69 @@ +{ + "name": "user-home", + "version": "1.1.1", + "description": "Get the path to the user home directory", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/user-home.git" + }, + "bin": { + "user-home": "cli.js" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "node test.js" + }, + "files": [ + "index.js", + "cli.js" + ], + "keywords": [ + "cli", + "bin", + "user", + "home", + "homedir", + "dir", + "directory", + "folder", + "path" + ], + "devDependencies": { + "ava": "0.0.3" + }, + "gitHead": "cf6ba885d3e6bf625fb3c15ad0334fa623968481", + "bugs": { + "url": "https://github.com/sindresorhus/user-home/issues" + }, + "homepage": "https://github.com/sindresorhus/user-home", + "_id": "user-home@1.1.1", + "_shasum": "2b5be23a32b63a7c9deb8d0f28d485724a3df190", + "_from": "user-home@>=1.0.0 <2.0.0", + "_npmVersion": "2.1.16", + "_nodeVersion": "0.10.32", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "dist": { + "shasum": "2b5be23a32b63a7c9deb8d0f28d485724a3df190", + "tarball": "http://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/tools/eslint/node_modules/user-home/readme.md b/tools/eslint/node_modules/user-home/readme.md new file mode 100644 index 0000000000..5307a07ef5 --- /dev/null +++ b/tools/eslint/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) |