class PoiseJavascript::Resources::JavascriptRuntime::Resource

A `javascript_runtime` resource to manage Javascript installations.

@provides javascript_runtime @action install @action uninstall @example

javascript_runtime '2.7'

Public Instance Methods

javascript_binary() click to toggle source

The path to the `node` binary for this Javascript installation. This is an output property.

@return [String] @example

execute "#{resources('javascript_runtime[nodejs]').javascript_binary} myapp.js"
# File lib/poise_javascript/resources/javascript_runtime.rb, line 54
def javascript_binary
  provider_for_action(:javascript_binary).javascript_binary
end
javascript_environment() click to toggle source

The environment variables for this Javascript installation. This is an output property.

@return [Hash<String, String>] @example

execute '/opt/myapp.js' do
  environment resources('javascript_runtime[nodejs]').javascript_environment
end
# File lib/poise_javascript/resources/javascript_runtime.rb, line 66
def javascript_environment
  provider_for_action(:javascript_environment).javascript_environment
end
npm_binary() click to toggle source

The path to the `npm` binary for this Javascript installation. This is an output property. Can raise an exception if NPM is not supported for this runtime.

@return [String] @example

execute "#{resources('javascript_runtime[nodejs]').npm_binary} install"
# File lib/poise_javascript/resources/javascript_runtime.rb, line 77
def npm_binary
  provider_for_action(:npm_binary).npm_binary
end