Assignment 7 – JSON World

Folder: csc336-fall2025/07-json-world/

Overview

In this assignment, you’ll design a small imaginary world in JSON, then write a simple Node.js script that reads and processes it.

Learning Goals

Part 1 – Create Your JSON World

Create a file called world.json that describes a small imaginary world using nested JSON. If you are having trouble with understanding JSON, see this: JSON Introduction (W3Schools)

JSON Structure Requirements

Validation

Before submitting, check that your JSON file is valid:

https://jsonlint.com/

Paste your JSON there and ensure you see “Valid JSON”.

Part 2 – Create a Node Script

In the same folder, create a file called world.js that:

Tip: In order to use import syntax in Node, you must create a file called package.json in the same folder and include this line inside it:
{
  "type": "module"
}

Then, your import at the top of world.js should look like this:

import * as fs from 'fs'; // or import fs from 'fs';

Run your program in the terminal with:

node world.js

Examples

Submission

Submit the following files:

Each file should be neatly formatted and easy to read.

NOTE: I'd rather you turn in broken json than generated json. So *please* actually try to learn JSON.