Finished initializing? Get started with coding!

If you haven’t initialized a project, go to Initialization to initialize a project then return back here.

Let’s get started with coding a program in Monterey, there are a few basics you need to learn before coding:

  1. Both JavaScript and Monterey JSON can be adapted into file, meaning you can execute or implement JavaScript code within the Monterey JSON file

  2. Monterey files for building must end with .monjson and must include a Monterey Header object. More at Monterey Header Information

  3. JavaScript Code can be transpiled to Monterey code using the monterey jsify command which is a command to convert JavaScript Code to a fully codable Monterey Program.

After initializing, your main.monjson should look like this:

main.monjson
{
  "$schema": "https://raw.githubusercontent.com/AbdullahCXD/monterey.js/refs/heads/develop/schema/monterey.schema.json",
  "header": {
    "montereyVersion": "v1.0.2",
    "environment": [],
    "settings": {
      "loadDotenv": true
     }
  },
  "javascript": {
      "top": "",
      "end": "",
      "async": false,
  },
  "variables": [],
  "functions": [],
  "classes": []
}

Normally building this empty file will just write comments of where the code will be:

main.js
/*
 * Generated by Monterey.js v1.0.1
 * https://github.com/AbdullahCXD/monterey.js
 * 
 * Generation Time: Mon, 10 Mar 2025 19:00:19 GMT
 * 
 * This is an auto-generated file. Do not edit directly.
 */
 
/* Generated Variables */

/* Generated Classes*/

/* Generated Functions */

Want some example code? See Examples