Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRebecca Turner <rebecca@npmjs.com>2015-06-12 04:45:09 +0300
committerRebecca Turner <rebecca@npmjs.com>2015-06-12 05:19:30 +0300
commite02e85d140756a2e1d82fc886d9a3f1f8d58526f (patch)
treed716e78f2240c8c12bcd7a37831e6e059b33b173 /node_modules/osenv
parent2dd055b19afb8d061c6633bf9f7254310d69eed6 (diff)
osenv@0.1.2
Use `os-tmpdir` to get tmpdir info for greater consistency between node versions.
Diffstat (limited to 'node_modules/osenv')
-rw-r--r--node_modules/osenv/.travis.yml9
-rw-r--r--node_modules/osenv/node_modules/os-tmpdir/index.js25
-rw-r--r--node_modules/osenv/node_modules/os-tmpdir/license21
-rw-r--r--node_modules/osenv/node_modules/os-tmpdir/package.json70
-rw-r--r--node_modules/osenv/node_modules/os-tmpdir/readme.md36
-rw-r--r--node_modules/osenv/osenv.js4
-rw-r--r--node_modules/osenv/package.json47
-rw-r--r--node_modules/osenv/test/windows.js5
8 files changed, 176 insertions, 41 deletions
diff --git a/node_modules/osenv/.travis.yml b/node_modules/osenv/.travis.yml
new file mode 100644
index 000000000..99f2bbf50
--- /dev/null
+++ b/node_modules/osenv/.travis.yml
@@ -0,0 +1,9 @@
+language: node_js
+language: node_js
+node_js:
+ - '0.8'
+ - '0.10'
+ - '0.12'
+ - 'iojs'
+before_install:
+ - npm install -g npm@latest
diff --git a/node_modules/osenv/node_modules/os-tmpdir/index.js b/node_modules/osenv/node_modules/os-tmpdir/index.js
new file mode 100644
index 000000000..52d90bf26
--- /dev/null
+++ b/node_modules/osenv/node_modules/os-tmpdir/index.js
@@ -0,0 +1,25 @@
+'use strict';
+var isWindows = process.platform === 'win32';
+var trailingSlashRe = isWindows ? /[^:]\\$/ : /.\/$/;
+
+// https://github.com/nodejs/io.js/blob/3e7a14381497a3b73dda68d05b5130563cdab420/lib/os.js#L25-L43
+module.exports = function () {
+ var path;
+
+ if (isWindows) {
+ path = process.env.TEMP ||
+ process.env.TMP ||
+ (process.env.SystemRoot || process.env.windir) + '\\temp';
+ } else {
+ path = process.env.TMPDIR ||
+ process.env.TMP ||
+ process.env.TEMP ||
+ '/tmp';
+ }
+
+ if (trailingSlashRe.test(path)) {
+ path = path.slice(0, -1);
+ }
+
+ return path;
+};
diff --git a/node_modules/osenv/node_modules/os-tmpdir/license b/node_modules/osenv/node_modules/os-tmpdir/license
new file mode 100644
index 000000000..654d0bfe9
--- /dev/null
+++ b/node_modules/osenv/node_modules/os-tmpdir/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/node_modules/osenv/node_modules/os-tmpdir/package.json b/node_modules/osenv/node_modules/os-tmpdir/package.json
new file mode 100644
index 000000000..1857f8f5f
--- /dev/null
+++ b/node_modules/osenv/node_modules/os-tmpdir/package.json
@@ -0,0 +1,70 @@
+{
+ "name": "os-tmpdir",
+ "version": "1.0.1",
+ "description": "Node.js os.tmpdir() ponyfill",
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/os-tmpdir.git"
+ },
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "scripts": {
+ "test": "node test.js"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "built-in",
+ "core",
+ "ponyfill",
+ "polyfill",
+ "shim",
+ "os",
+ "tmpdir",
+ "tempdir",
+ "tmp",
+ "temp",
+ "dir",
+ "directory",
+ "env",
+ "environment"
+ ],
+ "devDependencies": {
+ "ava": "0.0.4"
+ },
+ "gitHead": "5c5d355f81378980db629d60128ad03e02b1c1e5",
+ "bugs": {
+ "url": "https://github.com/sindresorhus/os-tmpdir/issues"
+ },
+ "homepage": "https://github.com/sindresorhus/os-tmpdir",
+ "_id": "os-tmpdir@1.0.1",
+ "_shasum": "e9b423a1edaf479882562e92ed71d7743a071b6e",
+ "_from": "os-tmpdir@>=1.0.0 <2.0.0",
+ "_npmVersion": "2.9.1",
+ "_nodeVersion": "0.12.3",
+ "_npmUser": {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ },
+ "dist": {
+ "shasum": "e9b423a1edaf479882562e92ed71d7743a071b6e",
+ "tarball": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.1.tgz"
+ },
+ "maintainers": [
+ {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ }
+ ],
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.1.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/node_modules/osenv/node_modules/os-tmpdir/readme.md b/node_modules/osenv/node_modules/os-tmpdir/readme.md
new file mode 100644
index 000000000..54d4c6ec8
--- /dev/null
+++ b/node_modules/osenv/node_modules/os-tmpdir/readme.md
@@ -0,0 +1,36 @@
+# os-tmpdir [![Build Status](https://travis-ci.org/sindresorhus/os-tmpdir.svg?branch=master)](https://travis-ci.org/sindresorhus/os-tmpdir)
+
+> Node.js [`os.tmpdir()`](https://nodejs.org/api/os.html#os_os_tmpdir) ponyfill
+
+> Ponyfill: A polyfill that doesn't overwrite the native method
+
+Use this instead of `require('os').tmpdir()` to get a consistent behaviour on different Node.js versions (even 0.8).
+
+*This is actually taken from io.js 2.0.2 as it contains some fixes that haven't bubbled up to Node.js yet.*
+
+
+## Install
+
+```
+$ npm install --save os-tmpdir
+```
+
+
+## Usage
+
+```js
+var osTmpdir = require('os-tmpdir');
+
+osTmpdir();
+//=> /var/folders/m3/5574nnhn0yj488ccryqr7tc80000gn/T
+```
+
+
+## API
+
+See the [`os.tmpdir()` docs](https://nodejs.org/api/os.html#os_os_tmpdir).
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/node_modules/osenv/osenv.js b/node_modules/osenv/osenv.js
index 7836fafcc..0cabcba66 100644
--- a/node_modules/osenv/osenv.js
+++ b/node_modules/osenv/osenv.js
@@ -1,7 +1,7 @@
var isWindows = process.platform === 'win32'
var path = require('path')
var exec = require('child_process').exec
-var os = require('os')
+var osTmpdir = require('os-tmpdir')
// looking up envs is a bit costly.
// Also, sometimes we want to have a fallback
@@ -46,7 +46,7 @@ memo('hostname', function () {
}, 'hostname')
memo('tmpdir', function () {
- return os.tmpDir()
+ return osTmpdir()
})
memo('home', function () {
diff --git a/node_modules/osenv/package.json b/node_modules/osenv/package.json
index 7f83dc0c0..851f19b51 100644
--- a/node_modules/osenv/package.json
+++ b/node_modules/osenv/package.json
@@ -1,13 +1,15 @@
{
"name": "osenv",
- "version": "0.1.1",
+ "version": "0.1.2",
"main": "osenv.js",
"directories": {
"test": "test"
},
- "dependencies": {},
+ "dependencies": {
+ "os-tmpdir": "^1.0.0"
+ },
"devDependencies": {
- "tap": "~0.4.9"
+ "tap": "^1.2.0"
},
"scripts": {
"test": "tap test/*.js"
@@ -32,41 +34,14 @@
},
"license": "ISC",
"description": "Look up environment settings specific to different operating systems",
- "gitHead": "769ada6737026254372e3013b702c450a9b781e9",
+ "readme": "# osenv\n\nLook up environment settings specific to different operating systems.\n\n## Usage\n\n```javascript\nvar osenv = require('osenv')\nvar path = osenv.path()\nvar user = osenv.user()\n// etc.\n\n// Some things are not reliably in the env, and have a fallback command:\nvar h = osenv.hostname(function (er, hostname) {\n h = hostname\n})\n// This will still cause it to be memoized, so calling osenv.hostname()\n// is now an immediate operation.\n\n// You can always send a cb, which will get called in the nextTick\n// if it's been memoized, or wait for the fallback data if it wasn't\n// found in the environment.\nosenv.hostname(function (er, hostname) {\n if (er) console.error('error looking up hostname')\n else console.log('this machine calls itself %s', hostname)\n})\n```\n\n## osenv.hostname()\n\nThe machine name. Calls `hostname` if not found.\n\n## osenv.user()\n\nThe currently logged-in user. Calls `whoami` if not found.\n\n## osenv.prompt()\n\nEither PS1 on unix, or PROMPT on Windows.\n\n## osenv.tmpdir()\n\nThe place where temporary files should be created.\n\n## osenv.home()\n\nNo place like it.\n\n## osenv.path()\n\nAn array of the places that the operating system will search for\nexecutables.\n\n## osenv.editor() \n\nReturn the executable name of the editor program. This uses the EDITOR\nand VISUAL environment variables, and falls back to `vi` on Unix, or\n`notepad.exe` on Windows.\n\n## osenv.shell()\n\nThe SHELL on Unix, which Windows calls the ComSpec. Defaults to 'bash'\nor 'cmd'.\n",
+ "readmeFilename": "README.md",
+ "gitHead": "88a154d6d8ad39fefb9af2fe1b306cd12fb6d6d0",
"bugs": {
"url": "https://github.com/npm/osenv/issues"
},
"homepage": "https://github.com/npm/osenv#readme",
- "_id": "osenv@0.1.1",
- "_shasum": "ddc7c4bb86c64a3022e95f030ee028e9a5996c07",
- "_from": "osenv@0.1.1",
- "_npmVersion": "2.10.0",
- "_nodeVersion": "2.0.1",
- "_npmUser": {
- "name": "isaacs",
- "email": "isaacs@npmjs.com"
- },
- "dist": {
- "shasum": "ddc7c4bb86c64a3022e95f030ee028e9a5996c07",
- "tarball": "http://registry.npmjs.org/osenv/-/osenv-0.1.1.tgz"
- },
- "maintainers": [
- {
- "name": "isaacs",
- "email": "i@izs.me"
- },
- {
- "name": "robertkowalski",
- "email": "rok@kowalski.gd"
- },
- {
- "name": "othiym23",
- "email": "ogd@aoaioxxysz.net"
- },
- {
- "name": "iarna",
- "email": "me@re-becca.org"
- }
- ],
- "_resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.1.tgz"
+ "_id": "osenv@0.1.2",
+ "_shasum": "f4d23ebeceaef078600fb78c0ea58fac5996a02d",
+ "_from": "osenv@latest"
}
diff --git a/node_modules/osenv/test/windows.js b/node_modules/osenv/test/windows.js
index 63ca45321..c9d837a32 100644
--- a/node_modules/osenv/test/windows.js
+++ b/node_modules/osenv/test/windows.js
@@ -3,9 +3,8 @@
// how the underlying system looks up module paths and runs
// child processes, and all that stuff is cached.
if (process.platform !== 'win32') {
- console.log('TAP Version 13\n' +
- '1..0\n' +
- '# Skip windows tests, this is not windows\n')
+ console.log('TAP version 13\n' +
+ '1..0 # Skip windows tests, this is not windows\n')
return
}