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:
This is the simplest possible QuickJS program that prints output to the console.
2

Run with qjs

Execute the script using the qjs interpreter:
Expected output:
3

Run in REPL mode

You can also run QuickJS in interactive mode without a file:
Then type JavaScript directly:

Next Steps