Skip to main content

Hello World

This tutorial shows you how to run your first JavaScript program with QuickJS-ng.
1

Create a JavaScript file

Create a file named hello.js with the following content:
console.log("Hello World");
This is the simplest possible QuickJS program that prints output to the console.
2

Run with qjs

Execute the script using the qjs interpreter:
qjs hello.js
Expected output:
Hello World
3

Run in REPL mode

You can also run QuickJS in interactive mode without a file:
qjs
Then type JavaScript directly:
QuickJS - Type "\\h" for help
qjs > console.log("Hello World");
Hello World
undefined
qjs > .exit

Next Steps

Build docs developers (and LLMs) love