pino-logflare
Advanced tools
Comparing version 0.3.12-0c69475a to 0.3.12-2a866d9e
import { LogflareUserOptionsI } from "logflare-transport-core"; | ||
declare const createConsoleWriteStream: (options: LogflareUserOptionsI) => any; | ||
declare const createConsoleWriteStream: (options: LogflareUserOptionsI) => { | ||
write: (chunk: any) => void; | ||
}; | ||
export default createConsoleWriteStream; |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var utils_1 = require("./utils"); | ||
var stream_browserify_1 = __importDefault(require("stream-browserify")); | ||
var utils_2 = require("./utils"); | ||
var createConsoleWriteStream = function (options) { | ||
var writeStream = new stream_browserify_1.default.Writable({ | ||
objectMode: true, | ||
highWaterMark: 1, | ||
}); | ||
writeStream._write = function (chunk, encoding, callback) { | ||
var batch = Array.isArray(chunk) ? chunk : [chunk]; | ||
batch | ||
.map(function (chunkItem) { return JSON.parse(chunkItem); }) | ||
.map(utils_1.toLogEntry) | ||
.map(function (logEntry) { | ||
return (0, utils_2.addLogflareTransformDirectives)(logEntry, options); | ||
}) | ||
.map(function (chunkItem) { return JSON.stringify(chunkItem); }) | ||
.forEach(function (x) { | ||
process.stdout.write(x + "\n"); | ||
}); | ||
callback(); | ||
return { | ||
write: function (chunk) { | ||
var batch = Array.isArray(chunk) ? chunk : [chunk]; | ||
batch | ||
.map(function (chunkItem) { return JSON.parse(chunkItem); }) | ||
.map(utils_1.toLogEntry) | ||
.map(function (logEntry) { | ||
return (0, utils_2.addLogflareTransformDirectives)(logEntry, options); | ||
}) | ||
.map(function (chunkItem) { return JSON.stringify(chunkItem); }) | ||
.forEach(function (x) { | ||
process.stdout.write(x + "\n"); | ||
}); | ||
}, | ||
}; | ||
return writeStream; | ||
}; | ||
exports.default = createConsoleWriteStream; | ||
//# sourceMappingURL=consoleStream.js.map |
@@ -7,3 +7,5 @@ import createHttpWriteStream from "./httpStream"; | ||
declare const logflarePinoVercel: (options: LogflareUserOptionsI) => { | ||
stream: any; | ||
stream: { | ||
write: (chunk: any) => void; | ||
}; | ||
send: (level: Level | number, logEvent: LogEvent) => void; | ||
@@ -10,0 +12,0 @@ }; |
{ | ||
"name": "pino-logflare", | ||
"version": "0.3.12-0c69475a", | ||
"version": "0.3.12-2a866d9e", | ||
"description": "A transport for Pino that sends messages to Logflare", | ||
@@ -66,3 +66,2 @@ "homepage": "https://github.com/logflare/pino-logflare", | ||
"split2": "^3.1.1", | ||
"stream-browserify": "^3.0.0", | ||
"through2": "^3.0.1" | ||
@@ -69,0 +68,0 @@ }, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8
28525
390
- Removedstream-browserify@^3.0.0
- Removedstream-browserify@3.0.0(transitive)