Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@timberio/node

Package Overview
Dependencies
Maintainers
5
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@timberio/node - npm Package Compare versions

Comparing version 0.30.0 to 0.31.0

4

dist/cjs/node.d.ts
/// <reference types="node" />
import { Duplex, Writable } from "stream";
import { ITimberLog, ITimberOptions, LogLevel } from "@timberio/types";
import { ITimberLog, Context, ITimberOptions, LogLevel } from "@timberio/types";
import { Base } from "@timberio/core";

@@ -20,3 +20,3 @@ export declare class Node extends Base {

*/
log(message: string, level?: LogLevel, log?: Partial<ITimberLog>): Promise<ITimberLog>;
log<TContext extends Context>(message: string, level?: LogLevel, context?: TContext): Promise<ITimberLog & TContext>;
/**

@@ -23,0 +23,0 @@ * Pipe JSON stringified `ITimberLog` to a stream after syncing

@@ -50,5 +50,5 @@ "use strict";

*/
async log(message, level, log) {
async log(message, level, context = {}) {
// Process/sync the log, per `Base` logic
const processedLog = await super.log(message, level, log);
const processedLog = await super.log(message, level, context);
// Push the processed log to the stream, for piping

@@ -55,0 +55,0 @@ if (this._writeStream) {

/// <reference types="node" />
import { Duplex, Writable } from "stream";
import { ITimberLog, ITimberOptions, LogLevel } from "@timberio/types";
import { ITimberLog, Context, ITimberOptions, LogLevel } from "@timberio/types";
import { Base } from "@timberio/core";

@@ -20,3 +20,3 @@ export declare class Node extends Base {

*/
log(message: string, level?: LogLevel, log?: Partial<ITimberLog>): Promise<ITimberLog>;
log<TContext extends Context>(message: string, level?: LogLevel, context?: TContext): Promise<ITimberLog & TContext>;
/**

@@ -23,0 +23,0 @@ * Pipe JSON stringified `ITimberLog` to a stream after syncing

@@ -45,5 +45,5 @@ import fetch from "cross-fetch";

*/
async log(message, level, log) {
async log(message, level, context = {}) {
// Process/sync the log, per `Base` logic
const processedLog = await super.log(message, level, log);
const processedLog = await super.log(message, level, context);
// Push the processed log to the stream, for piping

@@ -50,0 +50,0 @@ if (this._writeStream) {

{
"name": "@timberio/node",
"version": "0.30.0",
"version": "0.31.0",
"description": "Timber.io - Node.js logger",

@@ -43,5 +43,5 @@ "keywords": [

"dependencies": {
"@timberio/core": "^0.30.0",
"@timberio/tools": "^0.30.0",
"@timberio/types": "^0.30.0",
"@timberio/core": "^0.31.0",
"@timberio/tools": "^0.31.0",
"@timberio/types": "^0.31.0",
"@types/msgpack5": "^3.4.1",

@@ -51,3 +51,3 @@ "cross-fetch": "^2.2.3",

},
"gitHead": "16941238360eae52d6106dc864e11678fbac0636"
"gitHead": "03cb2806851c894e300389565ceae08df857461a"
}

@@ -7,3 +7,3 @@ import { Duplex, Writable } from "stream";

import { base64Encode } from "@timberio/tools";
import { ITimberLog, ITimberOptions, LogLevel } from "@timberio/types";
import { ITimberLog, Context, ITimberOptions, LogLevel } from "@timberio/types";
import { Base } from "@timberio/core";

@@ -64,9 +64,9 @@

*/
public async log(
public async log<TContext extends Context>(
message: string,
level?: LogLevel,
log?: Partial<ITimberLog>
): Promise<ITimberLog> {
context: TContext = {} as TContext
) {
// Process/sync the log, per `Base` logic
const processedLog = await super.log(message, level, log);
const processedLog = await super.log(message, level, context);

@@ -79,3 +79,3 @@ // Push the processed log to the stream, for piping

// Return the transformed log
return processedLog;
return processedLog as ITimberLog & TContext;
}

@@ -82,0 +82,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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