I want to access a json file from the parent directory where the files are set up like this
- files
- commands
- admin
- ban.js <-- the file I want my json in
- command_info.json
(yes this is for a discord.js bot)
in my ban.js
ive used these 4 things:
const {CommandInfo} = require("command_info.json")
const {CommandInfo} = require("./command_info.json")
const {CommandInfo} = require("../command_info.json")
const {CommandInfo} = require(".../command_info.json")
and none of them work as they throw the error:
Error: Cannot find module './dev_commands.json'
How would I get my ban.js
to include my dev_commands.json