Node.js
REPL Commands
Use Node.js's REPL (Read-Eval-Print Loop) for interactive JavaScript execution. Test code snippets, explore APIs, and prototype quickly without creating files.
5 commands
Pro Tips
Use '.load filename.js' in the REPL to load and execute a file, making its variables available.
Press Tab twice for autocompletion. Type 'global.' + Tab to explore available globals.
The '_' variable holds the last expression result. Use it to chain operations without assigning.
Common Mistakes
REPL mode enables top-level await by default, but regular .js files need 'type: module' in package.json.
REPL history is saved to ~/.node_repl_history. Be careful with sensitive data like API keys.