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/global-prefix/LICENSE | 21 ++++++ node_modules/global-prefix/index.js | 80 ++++++++++++++++++++ node_modules/global-prefix/package.json | 130 ++++++++++++++++++++++++++++++++ 3 files changed, 231 insertions(+) create mode 100644 node_modules/global-prefix/LICENSE create mode 100644 node_modules/global-prefix/index.js create mode 100644 node_modules/global-prefix/package.json (limited to 'node_modules/global-prefix') diff --git a/node_modules/global-prefix/LICENSE b/node_modules/global-prefix/LICENSE new file mode 100644 index 000000000..1e49edf81 --- /dev/null +++ b/node_modules/global-prefix/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2016, Jon Schlinkert. + +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/global-prefix/index.js b/node_modules/global-prefix/index.js new file mode 100644 index 000000000..591f6be8b --- /dev/null +++ b/node_modules/global-prefix/index.js @@ -0,0 +1,80 @@ +/*! + * global-prefix + * + * Copyright (c) 2015 Jon Schlinkert. + * Licensed under the MIT license. + */ + +'use strict'; + +var fs = require('fs') +var path = require('path'); +var osenv = require('osenv'); +var ini = require('ini'); + +var prefix; + +if (process.env.PREFIX) { + prefix = process.env.PREFIX; +} else { + // Start by checking if the global prefix is set by the user + var userConfig = path.resolve(osenv.home(), '.npmrc'); + prefix = readPrefix(userConfig); + + if (!prefix) { + // Otherwise find the path of npm + var npm = npmPath(); + if (npm) { + // Check the built-in npm config file + var builtinConfig = path.resolve(npm, '..', '..', 'npmrc'); + prefix = readPrefix(builtinConfig); + + if (prefix) { + // Now the global npm config can also be checked. + var globalConfig = path.resolve(prefix, 'etc', 'npmrc'); + prefix = readPrefix(globalConfig) || prefix; + } + } + + if (!prefix) fallback(); + } +} + +function fallback() { + var isWindows = require('is-windows'); + if (isWindows()) { + // c:\node\node.exe --> prefix=c:\node\ + prefix = process.env.APPDATA + ? path.join(process.env.APPDATA, 'npm') + : path.dirname(process.execPath); + } else { + // /usr/local/bin/node --> prefix=/usr/local + prefix = path.dirname(path.dirname(process.execPath)); + + // destdir only is respected on Unix + if (process.env.DESTDIR) { + prefix = path.join(process.env.DESTDIR, prefix); + } + } +} + +function npmPath() { + try { + return fs.realpathSync(require('which').sync('npm')) + } catch (ex) { + } + return false +} + +function readPrefix(configPath) { + try { + var data = fs.readFileSync(configPath, 'utf-8'); + var config = ini.parse(data); + if (config.prefix) return config.prefix; + } catch (ex) { + // file not found + } + return false; +} + +module.exports = prefix; diff --git a/node_modules/global-prefix/package.json b/node_modules/global-prefix/package.json new file mode 100644 index 000000000..44b7c168f --- /dev/null +++ b/node_modules/global-prefix/package.json @@ -0,0 +1,130 @@ +{ + "_args": [ + [ + { + "raw": "global-prefix@^0.1.4", + "scope": null, + "escapedName": "global-prefix", + "name": "global-prefix", + "rawSpec": "^0.1.4", + "spec": ">=0.1.4 <0.2.0", + "type": "range" + }, + "/home/dold/repos/taler/wallet-webex/node_modules/global-modules" + ] + ], + "_from": "global-prefix@>=0.1.4 <0.2.0", + "_id": "global-prefix@0.1.4", + "_inCache": true, + "_location": "/global-prefix", + "_nodeVersion": "6.2.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/global-prefix-0.1.4.tgz_1465117849156_0.5271593367215246" + }, + "_npmUser": { + "name": "jonschlinkert", + "email": "github@sellside.com" + }, + "_npmVersion": "3.8.9", + "_phantomChildren": {}, + "_requested": { + "raw": "global-prefix@^0.1.4", + "scope": null, + "escapedName": "global-prefix", + "name": "global-prefix", + "rawSpec": "^0.1.4", + "spec": ">=0.1.4 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/global-modules" + ], + "_resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-0.1.4.tgz", + "_shasum": "05158db1cde2dd491b455e290eb3ab8bfc45c6e1", + "_shrinkwrap": null, + "_spec": "global-prefix@^0.1.4", + "_where": "/home/dold/repos/taler/wallet-webex/node_modules/global-modules", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/global-prefix/issues" + }, + "dependencies": { + "ini": "^1.3.4", + "is-windows": "^0.2.0", + "osenv": "^0.1.3", + "which": "^1.2.10" + }, + "description": "Get the npm global path prefix.", + "devDependencies": { + "gulp-format-md": "^0.1.9", + "mocha": "^2.5.3" + }, + "directories": {}, + "dist": { + "shasum": "05158db1cde2dd491b455e290eb3ab8bfc45c6e1", + "tarball": "https://registry.npmjs.org/global-prefix/-/global-prefix-0.1.4.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "e436842c55f6a711a1d801e19d5142e58b80a8fd", + "homepage": "https://github.com/jonschlinkert/global-prefix", + "keywords": [ + "global", + "module", + "modules", + "npm", + "path", + "prefix", + "resolve" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "jonschlinkert", + "email": "github@sellside.com" + } + ], + "name": "global-prefix", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/global-prefix.git" + }, + "scripts": { + "test": "mocha" + }, + "verb": { + "run": true, + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "related": { + "list": [ + "global-modules", + "global-paths" + ] + }, + "reflinks": [ + "verb" + ], + "lint": { + "reflinks": true + } + }, + "version": "0.1.4" +} -- cgit v1.2.3