Class: Makit::Cli::Generators::Templates::Node::IndexJs
- Inherits:
-
Object
- Object
- Makit::Cli::Generators::Templates::Node::IndexJs
- Defined in:
- lib/makit/cli/generators/templates/node_templates.rb
Overview
Template generator for Node.js index.js entry point files
Generates a simple JavaScript file that outputs “Hello, World!” to the console. Provides a basic starting point for Node.js applications.
Instance Method Summary collapse
-
#initialize(project_name) ⇒ IndexJs
constructor
Initialize a new index.js template generator.
-
#render ⇒ String
Render the index.js JavaScript content.
Constructor Details
#initialize(project_name) ⇒ IndexJs
Initialize a new index.js template generator
67 68 69 |
# File 'lib/makit/cli/generators/templates/node_templates.rb', line 67 def initialize(project_name) @project_name = project_name end |
Instance Method Details
#render ⇒ String
Render the index.js JavaScript content
74 75 76 77 78 |
# File 'lib/makit/cli/generators/templates/node_templates.rb', line 74 def render <<~JAVASCRIPT console.log("Hello, World!"); JAVASCRIPT end |