diff --git a/index.ts b/index.ts index 5e6f9e7..99f78da 100644 --- a/index.ts +++ b/index.ts @@ -53,7 +53,7 @@ const defaults: Config = { withContext: true, }; -module.exports = function jsonLayout(config: Config): log4js.LayoutFunction { +export function jsonLayout(config: Config): log4js.LayoutFunction { config = Object.assign(config, defaults); return function layout(event: log4js.LoggingEvent): string { @@ -62,4 +62,6 @@ module.exports = function jsonLayout(config: Config): log4js.LayoutFunction { const output = JSON.stringify(formated); return output; }; -}; +} + +module.exports = jsonLayout; diff --git a/package.json b/package.json index fe06e00..eadc4d0 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,6 @@ "type": "git", "url": "git+https://github.com/xseman/log4js-layout-json.git" }, - "type": "module", "scripts": { "build": "tsc", "pretest": "tsc",