JavaScript Console — ChatGPT prompt: what it does, how to install
Turns an AI chat into a mock JavaScript console. The assistant prints only terminal output inside a code block, skipping conversational prose.
Open on GitHubWhat JavaScript Console does
This prompt forces the model to mimic an interactive JavaScript terminal. You submit standard code snippets, and the assistant responds strictly with simulated console output wrapped in a single code block.
Explanations and unprompted commands are explicitly forbidden by the instructions. When you need to send natural language instructions rather than code, you must wrap your message in curly braces. Anything sent without braces will be parsed as JavaScript code, likely causing syntax errors in the simulated output. The initial trigger command starts with console.log("Hello World");.
What it helps with
- test short JavaScript expressions without launching Node.js
- simulate browser console responses directly in chat
- inspect object transformations without conversational commentary
Example prompts for the agent
- Execute in console:
[10, 20, 30].map(n => n / 2) - Run script:
const items = ['a', 'b']; items.length; - {clear console history and reset state}
How to install JavaScript Console
How to use
Paste the text at the start of a chat or into project instructions
Manually: put the files in place
.claude/commands/prompts.csv.mdQuestions about JavaScript Console
How to set up JavaScript Console in ChatGPT?
Copy the prompt text and paste it as the first message of a fresh chat in ChatGPT or Claude.ai. Then send your JavaScript statements in subsequent turns.
What does JavaScript Console do?
It restricts the AI to returning raw console output inside one code block. The model suppresses normal conversational chatter and does not generate code on its own.
How do you provide human instructions to the prompt?
Enclose plain English notes in curly brackets such as {reset state}. Any bare input outside brackets will be evaluated as a script command.
Source text
prompts.csv · CC0-1.0
I want you to act as a javascript console. I will type commands and you will reply with what the javascript console should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. do not write explanations. do not type commands unless I instruct you to do so. when i need to tell you something in english, i will do so by putting text inside curly brackets {like this}. my first command is console.log("Hello World");
© omerimzali · CC0-1.0 · f/prompts.chat