New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@r2pos/nodejs-logger

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@r2pos/nodejs-logger - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

20

lib/index.d.ts

@@ -1,14 +0,8 @@

declare const logger: import("pino").Logger<{
transport: {
targets: {
level: string;
target: string;
options: {
translateTime: string;
messageFormat: string;
ignore: string;
};
}[];
import pino from "pino";
export interface LoggerOptions {
file: {
enabled: boolean;
destination: string;
};
}>;
export default logger;
}
export default function (options: LoggerOptions): pino.Logger<any>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var pino_1 = require("pino");
var logger = (0, pino_1.default)({
transport: {
targets: [
{
level: "debug",
target: "pino-pretty",
options: {
translateTime: "UTC:yyyy-mm-dd HH:MM:ss.l",
messageFormat: "[{tag}] {msg}",
ignore: "pid,hostname,tag",
},
function default_1(options) {
options = options || {};
var targets = [
{
level: "debug",
target: "pino/file",
options: {
destination: 1,
},
],
},
});
process.on("uncaughtException", function (err) {
logger.error(err, "uncaughtException error");
});
process.on("unhandledRejection", function (err) {
logger.error(err, "unhandledRejection error");
});
exports.default = logger;
},
];
if (options.file && options.file.enabled) {
targets.push({
level: "debug",
target: "pino/file",
options: {
destination: options.file.destination,
},
});
}
var logger = (0, pino_1.default)({
transport: {
targets: targets,
},
});
process.on("uncaughtException", function (err) {
logger.error(err, "uncaughtException error");
});
process.on("unhandledRejection", function (err) {
logger.error(err, "unhandledRejection error");
});
return logger;
}
exports.default = default_1;
{
"name": "@r2pos/nodejs-logger",
"version": "1.0.0",
"version": "1.0.1",
"description": "",

@@ -9,3 +9,4 @@ "main": "lib/index.js",

"build": "tsc -p tsconfig.json",
"prepare" : "npm run build"
"prepare": "npm run build",
"test": "npm run build && node test.js | sh run.sh | pino-pretty"
},

@@ -15,3 +16,5 @@ "keywords": [],

"license": "ISC",
"files": ["lib/**/*"],
"files": [
"lib/**/*"
],
"devDependencies": {

@@ -21,2 +24,3 @@ "@types/node": "^16.11.6",

"nodemon": "^2.0.14",
"pino-pretty": "^9.1.1",
"ts-node": "^10.4.0",

@@ -27,5 +31,4 @@ "tslint": "^5.12.1",

"dependencies": {
"pino": "^8.7.0",
"pino-pretty": "^9.1.1"
"pino": "^8.7.0"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc