????JFIF??x?x????'
| Server IP : 79.136.114.73 / Your IP : 216.73.216.55 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/doc/node-osenv/ |
Upload File : |
# osenv
Look up environment settings specific to different operating systems.
## Usage
```javascript
var osenv = require('osenv')
var path = osenv.path()
var user = osenv.user()
// etc.
// Some things are not reliably in the env, and have a fallback command:
var h = osenv.hostname(function (er, hostname) {
h = hostname
})
// This will still cause it to be memoized, so calling osenv.hostname()
// is now an immediate operation.
// You can always send a cb, which will get called in the nextTick
// if it's been memoized, or wait for the fallback data if it wasn't
// found in the environment.
osenv.hostname(function (er, hostname) {
if (er) console.error('error looking up hostname')
else console.log('this machine calls itself %s', hostname)
})
```
## osenv.hostname()
The machine name. Calls `hostname` if not found.
## osenv.user()
The currently logged-in user. Calls `whoami` if not found.
## osenv.prompt()
Either PS1 on unix, or PROMPT on Windows.
## osenv.tmpdir()
The place where temporary files should be created.
## osenv.home()
No place like it.
## osenv.path()
An array of the places that the operating system will search for
executables.
## osenv.editor()
Return the executable name of the editor program. This uses the EDITOR
and VISUAL environment variables, and falls back to `vi` on Unix, or
`notepad.exe` on Windows.
## osenv.shell()
The SHELL on Unix, which Windows calls the ComSpec. Defaults to 'bash'
or 'cmd'.