@nsshunt/stsutils 1.19.154 → 1.19.155

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/node.cjs CHANGED
@@ -45,6 +45,13 @@ var PidColours = class PidColours {
45
45
  info.message = `${PidColours.getPidColour(process.pid)(String(process.pid))} ${info.message}`;
46
46
  return info;
47
47
  });
48
+ static CreateRawWinstonLogger = (level = "debug") => {
49
+ return winston.default.createLogger({
50
+ level,
51
+ format: winston.default.format.combine(PidColours.pidFormat(), winston.default.format.colorize(), winston.default.format.simple()),
52
+ transports: [new winston.default.transports.Console()]
53
+ });
54
+ };
48
55
  };
49
56
  //#endregion
50
57
  exports.NodeInjectionContextStore = NodeInjectionContextStore;
package/dist/node.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"node.cjs","names":["AsyncLocalStorage","Chalk"],"sources":["../src/di-node.ts","../src/pidColours.ts"],"sourcesContent":["import { AsyncLocalStorage } from \"node:async_hooks\";\n\nimport { Injector, InjectionContextStore } from \"./di.js\";\n\nexport class NodeInjectionContextStore implements InjectionContextStore {\n private readonly storage = new AsyncLocalStorage<Injector>();\n\n run<T>(injector: Injector, fn: () => T): T {\n return this.storage.run(injector, fn);\n }\n\n get(): Injector | undefined {\n return this.storage.getStore();\n }\n}\n","import winston from \"winston\";\nimport { Chalk } from \"chalk\";\n\nexport class PidColours {\n private static readonly chalk = new Chalk({ level: 3 });\n\n private static readonly pidColours = new Map<\n number,\n (text: string) => string\n >();\n\n private static readonly randomChannel = () =>\n Math.floor(80 + Math.random() * 176);\n\n private static readonly getPidColour = (pid: number) => {\n let colour = PidColours.pidColours.get(pid);\n\n if (!colour) {\n colour = PidColours.chalk.rgb(\n PidColours.randomChannel(),\n PidColours.randomChannel(),\n PidColours.randomChannel()\n );\n\n PidColours.pidColours.set(pid, colour);\n }\n\n return colour;\n };\n\n static readonly GetPidColour = () => {\n return PidColours.getPidColour(process.pid);\n };\n\n static readonly GetPidFormat = (text: string) => {\n const colour = PidColours.getPidColour(process.pid);\n return `${colour(String(process.pid))} ${text}`;\n };\n\n static readonly GetPidFormatNoColour = (text: string) => {\n return `${process.pid} ${text}`;\n };\n\n static readonly pidFormatNoColour = winston.format((info) => {\n info.message = `${process.pid} ${info.message}`;\n return info;\n });\n\n static readonly pidFormat = winston.format((info) => {\n const colour = PidColours.getPidColour(process.pid);\n info.message = `${colour(String(process.pid))} ${info.message}`;\n return info;\n });\n}\n"],"mappings":";;;;;;;AAIA,IAAa,4BAAb,MAAwE;CACpE,UAA2B,IAAIA,iBAAAA,kBAA4B;CAE3D,IAAO,UAAoB,IAAgB;EACvC,OAAO,KAAK,QAAQ,IAAI,UAAU,EAAE;CACxC;CAEA,MAA4B;EACxB,OAAO,KAAK,QAAQ,SAAS;CACjC;AACJ;;;ACXA,IAAa,aAAb,MAAa,WAAW;CACpB,OAAwB,QAAQ,IAAIC,MAAAA,MAAM,EAAE,OAAO,EAAE,CAAC;CAEtD,OAAwB,6BAAa,IAAI,IAGvC;CAEF,OAAwB,sBACpB,KAAK,MAAM,KAAK,KAAK,OAAO,IAAI,GAAG;CAEvC,OAAwB,gBAAgB,QAAgB;EACpD,IAAI,SAAS,WAAW,WAAW,IAAI,GAAG;EAE1C,IAAI,CAAC,QAAQ;GACT,SAAS,WAAW,MAAM,IACtB,WAAW,cAAc,GACzB,WAAW,cAAc,GACzB,WAAW,cAAc,CAC7B;GAEA,WAAW,WAAW,IAAI,KAAK,MAAM;EACzC;EAEA,OAAO;CACX;CAEA,OAAgB,qBAAqB;EACjC,OAAO,WAAW,aAAa,QAAQ,GAAG;CAC9C;CAEA,OAAgB,gBAAgB,SAAiB;EAE7C,OAAO,GADQ,WAAW,aAAa,QAAQ,GACrC,CAAA,CAAO,OAAO,QAAQ,GAAG,CAAC,EAAE,GAAG;CAC7C;CAEA,OAAgB,wBAAwB,SAAiB;EACrD,OAAO,GAAG,QAAQ,IAAI,GAAG;CAC7B;CAEA,OAAgB,oBAAoB,QAAA,QAAQ,QAAQ,SAAS;EACzD,KAAK,UAAU,GAAG,QAAQ,IAAI,GAAG,KAAK;EACtC,OAAO;CACX,CAAC;CAED,OAAgB,YAAY,QAAA,QAAQ,QAAQ,SAAS;EAEjD,KAAK,UAAU,GADA,WAAW,aAAa,QAAQ,GAC7B,CAAA,CAAO,OAAO,QAAQ,GAAG,CAAC,EAAE,GAAG,KAAK;EACtD,OAAO;CACX,CAAC;AACL"}
1
+ {"version":3,"file":"node.cjs","names":["AsyncLocalStorage","Chalk"],"sources":["../src/di-node.ts","../src/pidColours.ts"],"sourcesContent":["import { AsyncLocalStorage } from \"node:async_hooks\";\n\nimport { Injector, InjectionContextStore } from \"./di.js\";\n\nexport class NodeInjectionContextStore implements InjectionContextStore {\n private readonly storage = new AsyncLocalStorage<Injector>();\n\n run<T>(injector: Injector, fn: () => T): T {\n return this.storage.run(injector, fn);\n }\n\n get(): Injector | undefined {\n return this.storage.getStore();\n }\n}\n","import winston from \"winston\";\nimport { Chalk } from \"chalk\";\n\nexport class PidColours {\n private static readonly chalk = new Chalk({ level: 3 });\n\n private static readonly pidColours = new Map<\n number,\n (text: string) => string\n >();\n\n private static readonly randomChannel = () =>\n Math.floor(80 + Math.random() * 176);\n\n private static readonly getPidColour = (pid: number) => {\n let colour = PidColours.pidColours.get(pid);\n\n if (!colour) {\n colour = PidColours.chalk.rgb(\n PidColours.randomChannel(),\n PidColours.randomChannel(),\n PidColours.randomChannel()\n );\n\n PidColours.pidColours.set(pid, colour);\n }\n\n return colour;\n };\n\n static readonly GetPidColour = () => {\n return PidColours.getPidColour(process.pid);\n };\n\n static readonly GetPidFormat = (text: string) => {\n const colour = PidColours.getPidColour(process.pid);\n return `${colour(String(process.pid))} ${text}`;\n };\n\n static readonly GetPidFormatNoColour = (text: string) => {\n return `${process.pid} ${text}`;\n };\n\n static readonly pidFormatNoColour = winston.format((info) => {\n info.message = `${process.pid} ${info.message}`;\n return info;\n });\n\n static readonly pidFormat = winston.format((info) => {\n const colour = PidColours.getPidColour(process.pid);\n info.message = `${colour(String(process.pid))} ${info.message}`;\n return info;\n });\n\n static readonly CreateRawWinstonLogger = (level: string = \"debug\") => {\n return winston.createLogger({\n level,\n format: winston.format.combine(\n PidColours.pidFormat(),\n winston.format.colorize(),\n winston.format.simple()\n ),\n transports: [new winston.transports.Console()],\n });\n };\n}\n"],"mappings":";;;;;;;AAIA,IAAa,4BAAb,MAAwE;CACpE,UAA2B,IAAIA,iBAAAA,kBAA4B;CAE3D,IAAO,UAAoB,IAAgB;EACvC,OAAO,KAAK,QAAQ,IAAI,UAAU,EAAE;CACxC;CAEA,MAA4B;EACxB,OAAO,KAAK,QAAQ,SAAS;CACjC;AACJ;;;ACXA,IAAa,aAAb,MAAa,WAAW;CACpB,OAAwB,QAAQ,IAAIC,MAAAA,MAAM,EAAE,OAAO,EAAE,CAAC;CAEtD,OAAwB,6BAAa,IAAI,IAGvC;CAEF,OAAwB,sBACpB,KAAK,MAAM,KAAK,KAAK,OAAO,IAAI,GAAG;CAEvC,OAAwB,gBAAgB,QAAgB;EACpD,IAAI,SAAS,WAAW,WAAW,IAAI,GAAG;EAE1C,IAAI,CAAC,QAAQ;GACT,SAAS,WAAW,MAAM,IACtB,WAAW,cAAc,GACzB,WAAW,cAAc,GACzB,WAAW,cAAc,CAC7B;GAEA,WAAW,WAAW,IAAI,KAAK,MAAM;EACzC;EAEA,OAAO;CACX;CAEA,OAAgB,qBAAqB;EACjC,OAAO,WAAW,aAAa,QAAQ,GAAG;CAC9C;CAEA,OAAgB,gBAAgB,SAAiB;EAE7C,OAAO,GADQ,WAAW,aAAa,QAAQ,GACrC,CAAA,CAAO,OAAO,QAAQ,GAAG,CAAC,EAAE,GAAG;CAC7C;CAEA,OAAgB,wBAAwB,SAAiB;EACrD,OAAO,GAAG,QAAQ,IAAI,GAAG;CAC7B;CAEA,OAAgB,oBAAoB,QAAA,QAAQ,QAAQ,SAAS;EACzD,KAAK,UAAU,GAAG,QAAQ,IAAI,GAAG,KAAK;EACtC,OAAO;CACX,CAAC;CAED,OAAgB,YAAY,QAAA,QAAQ,QAAQ,SAAS;EAEjD,KAAK,UAAU,GADA,WAAW,aAAa,QAAQ,GAC7B,CAAA,CAAO,OAAO,QAAQ,GAAG,CAAC,EAAE,GAAG,KAAK;EACtD,OAAO;CACX,CAAC;CAED,OAAgB,0BAA0B,QAAgB,YAAY;EAClE,OAAO,QAAA,QAAQ,aAAa;GACxB;GACA,QAAQ,QAAA,QAAQ,OAAO,QACnB,WAAW,UAAU,GACrB,QAAA,QAAQ,OAAO,SAAS,GACxB,QAAA,QAAQ,OAAO,OAAO,CAC1B;GACA,YAAY,CAAC,IAAI,QAAA,QAAQ,WAAW,QAAQ,CAAC;EACjD,CAAC;CACL;AACJ"}
package/dist/node.mjs CHANGED
@@ -42,6 +42,13 @@ var PidColours = class PidColours {
42
42
  info.message = `${PidColours.getPidColour(process.pid)(String(process.pid))} ${info.message}`;
43
43
  return info;
44
44
  });
45
+ static CreateRawWinstonLogger = (level = "debug") => {
46
+ return winston.createLogger({
47
+ level,
48
+ format: winston.format.combine(PidColours.pidFormat(), winston.format.colorize(), winston.format.simple()),
49
+ transports: [new winston.transports.Console()]
50
+ });
51
+ };
45
52
  };
46
53
  //#endregion
47
54
  export { NodeInjectionContextStore, PidColours };
package/dist/node.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"node.mjs","names":[],"sources":["../src/di-node.ts","../src/pidColours.ts"],"sourcesContent":["import { AsyncLocalStorage } from \"node:async_hooks\";\n\nimport { Injector, InjectionContextStore } from \"./di.js\";\n\nexport class NodeInjectionContextStore implements InjectionContextStore {\n private readonly storage = new AsyncLocalStorage<Injector>();\n\n run<T>(injector: Injector, fn: () => T): T {\n return this.storage.run(injector, fn);\n }\n\n get(): Injector | undefined {\n return this.storage.getStore();\n }\n}\n","import winston from \"winston\";\nimport { Chalk } from \"chalk\";\n\nexport class PidColours {\n private static readonly chalk = new Chalk({ level: 3 });\n\n private static readonly pidColours = new Map<\n number,\n (text: string) => string\n >();\n\n private static readonly randomChannel = () =>\n Math.floor(80 + Math.random() * 176);\n\n private static readonly getPidColour = (pid: number) => {\n let colour = PidColours.pidColours.get(pid);\n\n if (!colour) {\n colour = PidColours.chalk.rgb(\n PidColours.randomChannel(),\n PidColours.randomChannel(),\n PidColours.randomChannel()\n );\n\n PidColours.pidColours.set(pid, colour);\n }\n\n return colour;\n };\n\n static readonly GetPidColour = () => {\n return PidColours.getPidColour(process.pid);\n };\n\n static readonly GetPidFormat = (text: string) => {\n const colour = PidColours.getPidColour(process.pid);\n return `${colour(String(process.pid))} ${text}`;\n };\n\n static readonly GetPidFormatNoColour = (text: string) => {\n return `${process.pid} ${text}`;\n };\n\n static readonly pidFormatNoColour = winston.format((info) => {\n info.message = `${process.pid} ${info.message}`;\n return info;\n });\n\n static readonly pidFormat = winston.format((info) => {\n const colour = PidColours.getPidColour(process.pid);\n info.message = `${colour(String(process.pid))} ${info.message}`;\n return info;\n });\n}\n"],"mappings":";;;;AAIA,IAAa,4BAAb,MAAwE;CACpE,UAA2B,IAAI,kBAA4B;CAE3D,IAAO,UAAoB,IAAgB;EACvC,OAAO,KAAK,QAAQ,IAAI,UAAU,EAAE;CACxC;CAEA,MAA4B;EACxB,OAAO,KAAK,QAAQ,SAAS;CACjC;AACJ;;;ACXA,IAAa,aAAb,MAAa,WAAW;CACpB,OAAwB,QAAQ,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;CAEtD,OAAwB,6BAAa,IAAI,IAGvC;CAEF,OAAwB,sBACpB,KAAK,MAAM,KAAK,KAAK,OAAO,IAAI,GAAG;CAEvC,OAAwB,gBAAgB,QAAgB;EACpD,IAAI,SAAS,WAAW,WAAW,IAAI,GAAG;EAE1C,IAAI,CAAC,QAAQ;GACT,SAAS,WAAW,MAAM,IACtB,WAAW,cAAc,GACzB,WAAW,cAAc,GACzB,WAAW,cAAc,CAC7B;GAEA,WAAW,WAAW,IAAI,KAAK,MAAM;EACzC;EAEA,OAAO;CACX;CAEA,OAAgB,qBAAqB;EACjC,OAAO,WAAW,aAAa,QAAQ,GAAG;CAC9C;CAEA,OAAgB,gBAAgB,SAAiB;EAE7C,OAAO,GADQ,WAAW,aAAa,QAAQ,GACrC,CAAA,CAAO,OAAO,QAAQ,GAAG,CAAC,EAAE,GAAG;CAC7C;CAEA,OAAgB,wBAAwB,SAAiB;EACrD,OAAO,GAAG,QAAQ,IAAI,GAAG;CAC7B;CAEA,OAAgB,oBAAoB,QAAQ,QAAQ,SAAS;EACzD,KAAK,UAAU,GAAG,QAAQ,IAAI,GAAG,KAAK;EACtC,OAAO;CACX,CAAC;CAED,OAAgB,YAAY,QAAQ,QAAQ,SAAS;EAEjD,KAAK,UAAU,GADA,WAAW,aAAa,QAAQ,GAC7B,CAAA,CAAO,OAAO,QAAQ,GAAG,CAAC,EAAE,GAAG,KAAK;EACtD,OAAO;CACX,CAAC;AACL"}
1
+ {"version":3,"file":"node.mjs","names":[],"sources":["../src/di-node.ts","../src/pidColours.ts"],"sourcesContent":["import { AsyncLocalStorage } from \"node:async_hooks\";\n\nimport { Injector, InjectionContextStore } from \"./di.js\";\n\nexport class NodeInjectionContextStore implements InjectionContextStore {\n private readonly storage = new AsyncLocalStorage<Injector>();\n\n run<T>(injector: Injector, fn: () => T): T {\n return this.storage.run(injector, fn);\n }\n\n get(): Injector | undefined {\n return this.storage.getStore();\n }\n}\n","import winston from \"winston\";\nimport { Chalk } from \"chalk\";\n\nexport class PidColours {\n private static readonly chalk = new Chalk({ level: 3 });\n\n private static readonly pidColours = new Map<\n number,\n (text: string) => string\n >();\n\n private static readonly randomChannel = () =>\n Math.floor(80 + Math.random() * 176);\n\n private static readonly getPidColour = (pid: number) => {\n let colour = PidColours.pidColours.get(pid);\n\n if (!colour) {\n colour = PidColours.chalk.rgb(\n PidColours.randomChannel(),\n PidColours.randomChannel(),\n PidColours.randomChannel()\n );\n\n PidColours.pidColours.set(pid, colour);\n }\n\n return colour;\n };\n\n static readonly GetPidColour = () => {\n return PidColours.getPidColour(process.pid);\n };\n\n static readonly GetPidFormat = (text: string) => {\n const colour = PidColours.getPidColour(process.pid);\n return `${colour(String(process.pid))} ${text}`;\n };\n\n static readonly GetPidFormatNoColour = (text: string) => {\n return `${process.pid} ${text}`;\n };\n\n static readonly pidFormatNoColour = winston.format((info) => {\n info.message = `${process.pid} ${info.message}`;\n return info;\n });\n\n static readonly pidFormat = winston.format((info) => {\n const colour = PidColours.getPidColour(process.pid);\n info.message = `${colour(String(process.pid))} ${info.message}`;\n return info;\n });\n\n static readonly CreateRawWinstonLogger = (level: string = \"debug\") => {\n return winston.createLogger({\n level,\n format: winston.format.combine(\n PidColours.pidFormat(),\n winston.format.colorize(),\n winston.format.simple()\n ),\n transports: [new winston.transports.Console()],\n });\n };\n}\n"],"mappings":";;;;AAIA,IAAa,4BAAb,MAAwE;CACpE,UAA2B,IAAI,kBAA4B;CAE3D,IAAO,UAAoB,IAAgB;EACvC,OAAO,KAAK,QAAQ,IAAI,UAAU,EAAE;CACxC;CAEA,MAA4B;EACxB,OAAO,KAAK,QAAQ,SAAS;CACjC;AACJ;;;ACXA,IAAa,aAAb,MAAa,WAAW;CACpB,OAAwB,QAAQ,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;CAEtD,OAAwB,6BAAa,IAAI,IAGvC;CAEF,OAAwB,sBACpB,KAAK,MAAM,KAAK,KAAK,OAAO,IAAI,GAAG;CAEvC,OAAwB,gBAAgB,QAAgB;EACpD,IAAI,SAAS,WAAW,WAAW,IAAI,GAAG;EAE1C,IAAI,CAAC,QAAQ;GACT,SAAS,WAAW,MAAM,IACtB,WAAW,cAAc,GACzB,WAAW,cAAc,GACzB,WAAW,cAAc,CAC7B;GAEA,WAAW,WAAW,IAAI,KAAK,MAAM;EACzC;EAEA,OAAO;CACX;CAEA,OAAgB,qBAAqB;EACjC,OAAO,WAAW,aAAa,QAAQ,GAAG;CAC9C;CAEA,OAAgB,gBAAgB,SAAiB;EAE7C,OAAO,GADQ,WAAW,aAAa,QAAQ,GACrC,CAAA,CAAO,OAAO,QAAQ,GAAG,CAAC,EAAE,GAAG;CAC7C;CAEA,OAAgB,wBAAwB,SAAiB;EACrD,OAAO,GAAG,QAAQ,IAAI,GAAG;CAC7B;CAEA,OAAgB,oBAAoB,QAAQ,QAAQ,SAAS;EACzD,KAAK,UAAU,GAAG,QAAQ,IAAI,GAAG,KAAK;EACtC,OAAO;CACX,CAAC;CAED,OAAgB,YAAY,QAAQ,QAAQ,SAAS;EAEjD,KAAK,UAAU,GADA,WAAW,aAAa,QAAQ,GAC7B,CAAA,CAAO,OAAO,QAAQ,GAAG,CAAC,EAAE,GAAG,KAAK;EACtD,OAAO;CACX,CAAC;CAED,OAAgB,0BAA0B,QAAgB,YAAY;EAClE,OAAO,QAAQ,aAAa;GACxB;GACA,QAAQ,QAAQ,OAAO,QACnB,WAAW,UAAU,GACrB,QAAQ,OAAO,SAAS,GACxB,QAAQ,OAAO,OAAO,CAC1B;GACA,YAAY,CAAC,IAAI,QAAQ,WAAW,QAAQ,CAAC;EACjD,CAAC;CACL;AACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nsshunt/stsutils",
3
- "version": "1.19.154",
3
+ "version": "1.19.155",
4
4
  "description": "STS Utils",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -9,5 +9,6 @@ export declare class PidColours {
9
9
  static readonly GetPidFormatNoColour: (text: string) => string;
10
10
  static readonly pidFormatNoColour: winston.Logform.FormatWrap;
11
11
  static readonly pidFormat: winston.Logform.FormatWrap;
12
+ static readonly CreateRawWinstonLogger: (level?: string) => winston.Logger;
12
13
  }
13
14
  //# sourceMappingURL=pidColours.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pidColours.d.ts","sourceRoot":"","sources":["../src/pidColours.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAG9B,qBAAa,UAAU;IACnB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAA2B;IAExD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAG9B;IAEJ,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CACI;IAEzC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAclC;IAEF,MAAM,CAAC,QAAQ,CAAC,YAAY,eAtBjB,MAAM,KAAK,MAAM,CAwB1B;IAEF,MAAM,CAAC,QAAQ,CAAC,YAAY,GAAI,MAAM,MAAM,YAG1C;IAEF,MAAM,CAAC,QAAQ,CAAC,oBAAoB,GAAI,MAAM,MAAM,YAElD;IAEF,MAAM,CAAC,QAAQ,CAAC,iBAAiB,6BAG9B;IAEH,MAAM,CAAC,QAAQ,CAAC,SAAS,6BAItB;CACN"}
1
+ {"version":3,"file":"pidColours.d.ts","sourceRoot":"","sources":["../src/pidColours.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAG9B,qBAAa,UAAU;IACnB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAA2B;IAExD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAG9B;IAEJ,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CACI;IAEzC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAclC;IAEF,MAAM,CAAC,QAAQ,CAAC,YAAY,eAtBjB,MAAM,KAAK,MAAM,CAwB1B;IAEF,MAAM,CAAC,QAAQ,CAAC,YAAY,GAAI,MAAM,MAAM,YAG1C;IAEF,MAAM,CAAC,QAAQ,CAAC,oBAAoB,GAAI,MAAM,MAAM,YAElD;IAEF,MAAM,CAAC,QAAQ,CAAC,iBAAiB,6BAG9B;IAEH,MAAM,CAAC,QAAQ,CAAC,SAAS,6BAItB;IAEH,MAAM,CAAC,QAAQ,CAAC,sBAAsB,GAAI,QAAO,MAAgB,oBAU/D;CACL"}