This commit is contained in:
Chomp 2022-05-17 10:07:16 +01:00
parent f61438bb1d
commit 8c7913f896
2 changed files with 5 additions and 4 deletions

View File

@ -1,5 +1,5 @@
{ {
"name": "EditDatabase", "name": "UseACustomConfigFile",
"version": "1.0.0", "version": "1.0.0",
"main": "src/mod.js", "main": "src/mod.js",
"license": "MIT", "license": "MIT",

View File

@ -2,10 +2,11 @@ import type { DependencyContainer } from "tsyringe";
import { IMod } from "../types/@types/external/mod"; import { IMod } from "../types/@types/external/mod";
import type { ILogger } from "../types/@types/spt/utils/ILogger"; import type { ILogger } from "../types/@types/spt/utils/ILogger";
import * as modConfig from "../config/config.json";
class Mod implements IMod class Mod implements IMod
{ {
private modConfig = require("../config/config.json");
// not used for this example // not used for this example
public load(container: DependencyContainer): void public load(container: DependencyContainer): void
{ return } { return }
@ -16,7 +17,7 @@ class Mod implements IMod
const logger = container.resolve<ILogger>("WinstonLogger"); const logger = container.resolve<ILogger>("WinstonLogger");
// log the 'myProperty' value to the console // 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}`);
} }
} }