whech
install - documentation - license
which the heck directions for
- Was the script run from a bin?
- There is some config file asociated to it?
- What is the main or/and global
node_modules
directory? - Get me some fields of their the local and global packages
usage
var whech = ; whechext = '.js'; ;
documentation
The module.exports
a function
var whech =
which is asynchronous. To use the sync
version take whech.sync
.
whech
arguments
spec
type string or object with a name property that is a stringcallback
type function to be called with the lasterror
andspec
Errors are attached to spec
a property instead of throwing.
spec properties
ext
type string, the extension of the configFilename
type string the name given as a string or object propertywhich
type string first instance of an executable in the PATHrunFromBin
type boolean, wether or notprocess.argv
containswhich
configFile
type string,configFile
if givenlocalDir
type string, the global dir where node_modules are installedglobalDir
: type string, the local dir where node_modules are installedlocalPackage
:require(path.join(name, 'package'))
globalPackage
:require(path.join(localDir, name, 'package'))
defaults
configfile
will default toname + 'file' + (spec.ext || '.js')
whech.sync
arguments
spec
, type string|object, the same as the async version
returns
spec
with same properties listed above
install
With npm
npm install whech
test
npm test
todo
- More tests
- Review and see if there is something missing