Problem Statement:
Create a function executeCommand(command)
that takes a shell command as input and executes it using the child_process
module. The function should print the output of the command to the console.
Function Signature:
function executeCommand(command) {
// Implementation
}
Expected Output:
Command Output:
File1.txt
File2.txt
Test Cases:
executeCommand('ls -la');
// Expected Output: (output of ls -la)
executeCommand('echo "Hello, Node.js!"');
// Expected Output: Hello, Node.js!