### Run Node.js Applications with Console Ninja Prefix Source: https://github.com/wallabyjs/console-ninja/blob/main/README.md Examples demonstrating how to prefix various Node.js application execution commands with `console-ninja` to enable its functionality. This includes direct Node.js execution, watch mode, and common package manager scripts. ```Shell console-ninja node app.js ``` ```Shell console-ninja node --watch app.js ``` ```Shell console-ninja npx nodemon app.js ``` ```Shell console-ninja npm run dev ``` ```Shell console-ninja yarn node app.js ``` ```Shell console-ninja npx tsx app.ts ``` ```Shell console-ninja npx ts-node app.ts ``` -------------------------------- ### Clear Build Tool Caches Source: https://github.com/wallabyjs/console-ninja/blob/main/README.md These shell commands help resolve potential runtime issues, such as Console Ninja websocket errors, by clearing various build tool caches after Console Ninja has been stopped. Users should run the command relevant to their project setup to ensure a clean state. ```Shell rm -rf node_modules/.cache rm -rf .next rm -rf .angular ``` -------------------------------- ### Configure Console Ninja MCP Server Globally for Cursor Source: https://github.com/wallabyjs/console-ninja/blob/main/README.md This JSON configuration adds the Console Ninja MCP server to Cursor's global `~/.cursor/mcp.json` file, making it accessible across all projects. It defines the command and arguments necessary for Cursor to initiate and connect to the Console Ninja MCP server. ```json { "mcpServers": { "console-ninja": { "command": "node", "args": ["~/.console-ninja/mcp/"] } } } ``` -------------------------------- ### Configure Console Ninja MCP Server for Specific Copilot Projects Source: https://github.com/wallabyjs/console-ninja/blob/main/README.md This JSON configuration adds the Console Ninja MCP server to a project's local `.vscode/mcp.json` file, ensuring it is only active for that particular project within Copilot Agent. The snippet includes OS-specific commands for launching the server, adapting to the respective operating system's environment. ```json { "servers": { "console-ninja": { "command": "npx", "args": ["-y", "-c", "node ~/.console-ninja/mcp/"] } } } ``` ```json { "servers": { "console-ninja": { "command": "npx", "args": ["/c", "node", "%USERPROFILE%/.console-ninja/mcp/"] } } } ``` -------------------------------- ### Configure Console Ninja MCP Server Globally for Copilot Agent Source: https://github.com/wallabyjs/console-ninja/blob/main/README.md This JSON configuration adds the Console Ninja MCP server to VS Code's global `settings.json` file, making it available for all projects when using Copilot Agent. It specifies the command and arguments required to launch the server, with variations for MacOS/Linux and Windows to handle different path conventions and command execution. ```json { ... "mcp": { "servers": { "console-ninja": { "command": "npx", "args": ["-y", "-c", "node ~/.console-ninja/mcp/"] } } } } ``` ```json { ... "mcp": { "servers": { "console-ninja": { "command": "cmd.exe", "args": ["/c", "node", "%USERPROFILE%/.console-ninja/mcp/"] } } } } ``` -------------------------------- ### Configure Console Ninja MCP Server Globally for Windsurf Source: https://github.com/wallabyjs/console-ninja/blob/main/README.md This JSON configuration adds the Console Ninja MCP server to Windsurf's custom server settings, typically accessed via the `Windsurf: MCP Configuration Panel` command. It includes OS-specific commands for launching the server, ensuring compatibility with both MacOS/Linux and Windows environments. ```json { "mcpServers": { "console-ninja": { "command": "npx", "args": ["-y", "-c", "node ~/.console-ninja/mcp/"] } } } ``` ```json { "mcpServers": { "console-ninja": { "command": "cmd.exe", "args": ["/c", "node", "%USERPROFILE%/.console-ninja/mcp/"] } } } ``` -------------------------------- ### Configure Console Ninja MCP Server (MacOS/Linux) Source: https://github.com/wallabyjs/console-ninja/blob/main/README.md Configuration entry for adding the Console Ninja MCP server to various MCP clients, including Roo Code, on MacOS/Linux. This JSON snippet defines the command to launch the server using `npx`. ```json { "mcpServers": { "console-ninja": { "command": "npx", "args": ["-y", "-c", "node ~/.console-ninja/mcp/"] } } } ``` -------------------------------- ### Configure Console Ninja MCP Server (Windows) Source: https://github.com/wallabyjs/console-ninja/blob/main/README.md Configuration entry for adding the Console Ninja MCP server to various MCP clients, including Roo Code, on Windows. This JSON snippet defines the command to launch the server using `cmd.exe`. ```json { "mcpServers": { "console-ninja": { "command": "cmd.exe", "args": ["/c", "node", "%USERPROFILE%/.console-ninja/mcp/"] } } } ``` -------------------------------- ### Configure Console Ninja MCP Server for Specific Cursor Projects Source: https://github.com/wallabyjs/console-ninja/blob/main/README.md This JSON configuration adds the Console Ninja MCP server to a project's local `.cursor/mcp.json` file, enabling its functionality exclusively for that specific project within Cursor. It specifies the command and arguments for the server, ensuring project-level isolation. ```json { "mcpServers": { "console-ninja": { "command": "node", "args": ["~/.console-ninja/mcp/"] } } } ``` -------------------------------- ### Configure Console Ninja MCP Server Globally for Cline Source: https://github.com/wallabyjs/console-ninja/blob/main/README.md This JSON configuration adds the Console Ninja MCP server to Cline's MCP server configuration file, which can be accessed through the `Cline: Focus on View` command. It provides OS-specific commands for launching the server, accommodating both MacOS/Linux and Windows operating systems. ```json { "mcpServers": { "console-ninja": { "command": "npx", "args": ["-y", "-c", "node ~/.console-ninja/mcp/"] } } } ``` ```json { "mcpServers": { "console-ninja": { "command": "cmd.exe", "args": ["/c", "node", "%USERPROFILE%/.console-ninja/mcp/"] } } } ``` -------------------------------- ### Source Console Ninja for Automatic Prefixing in Shell Sessions Source: https://github.com/wallabyjs/console-ninja/blob/main/README.md Instructions for UNIX-based systems to source the `console-ninja` command, allowing subsequent Node.js application executions within the same terminal session to automatically use Console Ninja without explicit prefixing. ```Shell source console-ninja ``` ```Shell node app1.js ``` ```Shell node app2.js ``` -------------------------------- ### Console Ninja Copilot Chat Commands for Log Investigation Source: https://github.com/wallabyjs/console-ninja/blob/main/README.md These commands allow users to explicitly request Console Ninja, via the GitHub Copilot chat, to check application logs for specific files or at particular line numbers, providing more targeted context for AI-driven error investigation. ```APIDOC @console-ninja check logs for src/file.ts ``` ```APIDOC @console-ninja check logs for src/file.ts at line 10 ``` -------------------------------- ### Displaying Call Stack Trace with console.trace in Console Ninja Source: https://github.com/wallabyjs/console-ninja/blob/main/README.md Using `console.trace` with Console Ninja allows developers to view the full call stack trace directly in the editor, next to the `console.trace` call. This provides immediate context for debugging, with the trace also available in the log viewer for detailed inspection. ```JavaScript function thirdFunc() { console.trace('Tracing execution path'); } function secondFunc() { thirdFunc(); } function firstFunc() { secondFunc(); } firstFunc(); ``` -------------------------------- ### Displaying Log Output with console.log in Console Ninja Source: https://github.com/wallabyjs/console-ninja/blob/main/README.md Console Ninja enhances standard `console.log` statements by displaying their output directly within the editor, adjacent to the code line. Hovering over the output provides additional details, and logs are also sent to the dedicated log viewer for comprehensive analysis. ```JavaScript console.log('Hello from Console Ninja!'); const data = { id: 1, name: 'Example' }; console.log('Current data:', data); ``` -------------------------------- ### Measuring Execution Time with console.time and console.timeEnd in Console Ninja Source: https://github.com/wallabyjs/console-ninja/blob/main/README.md Console Ninja integrates with `console.time` and `console.timeEnd` to measure and display the execution duration of code blocks directly in the editor. The elapsed time is shown next to the `console.timeEnd` call, and the timing data is also recorded in the log viewer for performance monitoring. ```JavaScript console.time('dataProcessing'); // Simulate some CPU-intensive work let sum = 0; for (let i = 0; i < 1000000; i++) { sum += Math.sqrt(i); } console.timeEnd('dataProcessing'); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.