lib/esvg.rb
# Determine if an NPM module is installed by checking paths with `npm bin`
# Returns path to binary if installed
Determine if an NPM module is installed by checking paths with `npm bin`
Returns path to binary if installed
Determine if an NPM module is installed by checking paths with ` npm bin ` Returns path to binary if installed
def node_module(cmd)
    @modules ||={}
    return @modules[cmd] if !@modules[cmd].nil?
    local = "$(npm bin)/#{cmd}"
    global = "$(npm -g bin)/#{cmd}"
    @modules[cmd] = if Open3.capture3(local)[2].success?
      local
    elsif Open3.capture3(global)[2].success?
      global
    else
      false
    end
  end
def node_module ( cmd ) @modules ||= { } return @modules [ cmd ] if ! @modules [ cmd ] . nil? local = "$(npm bin)/#{cmd}" global = "$(npm -g bin)/#{cmd}" @modules [ cmd ] = if Open3 . capture3 ( local ) [ 2 ] . success? local elsif Open3 . capture3 ( global ) [ 2 ] . success? global else false end end
Determine if an NPM module is installed by checking paths with `npm bin`
Returns path to binary if installed
Determine if an NPM module is installed by checking paths with ` npm bin ` Returns path to binary if installed
cmd
<not_specific>