diff --git a/TypeScript/4UseACustomConfigFile/package.json b/TypeScript/4UseACustomConfigFile/package.json index 87a132f..cfa0bd8 100644 --- a/TypeScript/4UseACustomConfigFile/package.json +++ b/TypeScript/4UseACustomConfigFile/package.json @@ -1,5 +1,5 @@ { - "name": "EditDatabase", + "name": "UseACustomConfigFile", "version": "1.0.0", "main": "src/mod.js", "license": "MIT", diff --git a/TypeScript/4UseACustomConfigFile/src/mod.ts b/TypeScript/4UseACustomConfigFile/src/mod.ts index d207e8d..1ea8830 100644 --- a/TypeScript/4UseACustomConfigFile/src/mod.ts +++ b/TypeScript/4UseACustomConfigFile/src/mod.ts @@ -2,21 +2,22 @@ import type { DependencyContainer } from "tsyringe"; import { IMod } from "../types/@types/external/mod"; import type { ILogger } from "../types/@types/spt/utils/ILogger"; -import * as modConfig from "../config/config.json"; class Mod implements IMod { + private modConfig = require("../config/config.json"); + // not used for this example public load(container: DependencyContainer): void { return } public delayedLoad(container: DependencyContainer): void - { + { // get logger const logger = container.resolve("WinstonLogger"); // log the 'myProperty' value to the console - logger.info(`here is the value from my config: ${modConfig.myProperty}`); + logger.info(`here is the value from my config: ${this.modConfig.myProperty}`); } }