Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
This repository was archived by the owner on Aug 11, 2021. It is now read-only.
/osenvPublic archive

Look up environment settings specific to different operating systems.

License

NotificationsYou must be signed in to change notification settings

npm/osenv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Look up environment settings specific to different operating systems.

Usage

varosenv=require('osenv')varpath=osenv.path()varuser=osenv.user()// etc.// Some things are not reliably in the env, and have a fallback command:varh=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')elseconsole.log('this machine calls itself %s',hostname)})

osenv.hostname()

The machine name. Callshostname if not found.

osenv.user()

The currently logged-in user. Callswhoami 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 forexecutables.

osenv.editor()

Return the executable name of the editor program. This uses the EDITORand VISUAL environment variables, and falls back tovi on Unix, ornotepad.exe on Windows.

osenv.shell()

The SHELL on Unix, which Windows calls the ComSpec. Defaults to 'bash'or 'cmd'.

About

Look up environment settings specific to different operating systems.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp