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",
"main": "src/mod.js",
"license": "MIT",

View File

@ -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<ILogger>("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}`);
}
}