From 1b61f17f617a6860560515fed2b647846b6c94fb Mon Sep 17 00:00:00 2001 From: RGBCube Date: Fri, 27 Jan 2023 15:18:57 -0500 Subject: [PATCH] Fix: add type: module to package.json --- main.js | 3 ++- package.json | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 27c0a29..cafdd15 100644 --- a/main.js +++ b/main.js @@ -1,7 +1,8 @@ +import fs from "fs"; import Twitter from "twit"; import { Webhook } from "discord-webhook-node"; -const config = require("config.json"); +const config = JSON.parse(fs.readFileSync("./config.json")); const dClient = new Webhook(config.discord.webhookUrl); dClient.setUsername(config.discord.webhookName); diff --git a/package.json b/package.json index 21d00b6..8e17f07 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "main": "main.js", "author": "Stovven & RGBCube", "license": "AGPL", + "type": "module", "dependencies": { "discord-webhook-node": "^1.1.8", "twit": "^2.2.11"