For developing packaged applications in GJS we highly recommend GNOME Builderopen in new window. GNOME Builder can download the latest GJS version for you and provides support for developing secure, structured GNOME applications.
If you do not have GNOME Builder installed you can get it hereopen in new window.
Using GNOME Builder
Creating a New GJS GTK Application Project

First open GNOME Builder and select New...
to create a new project.

Choose JavaScript
and GNOME Application
so GNOME Builder correctly configures and creates a template for you to build your first project from.

Configuring the Runtime Environment
Go to build settings.
In your application ensure that the runtime environment is set to Gnome Platform 3.28 or higher.
Working in Other IDES
If you are working in another IDE it is possible but more complicated.
Download the Template
First, download the application template (or use git clone [link]
)
Install GJS
Install GJS from any of the packages below.
- Ubuntu 18.04open in new window
- Fedora 28open in new window
- Debianopen in new window Warning: Out of Date In Stretch
- Arch Linuxopen in new window
- more at pkgs.orgopen in new window
Verifying Your GJS Version
Verify your system has a recent version of GJS. Type...
gjs --version
...into a terminal. You can see the features your version of GTK supports here. If your version is below 1.50.x it is recommended you use GNOME Builderopen in new window or build GJS from source.
Building Your Project
To build your project open a terminal in your project's root directory and type the following...
meson --set-prefix=***/your/project/directory***/run/
...to initialize Meson. Now type...
mkdir build && cd build && ninja && ninja build
Running Your Project
Type...
./run/**your.app.name**