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

winston-telegram

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

winston-telegram

A Telegram transport for winston

  • 2.7.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

winston-telegram

NPM

A Telegram transport for winston.

Version npm npm Downloads CI Status Coverage Status JavaScript Style Guide

winston-telegram@2

Installation:

$ npm install winston@3
$ npm install winston-telegram@2

Looking for winston-telegram@1.x ?

Documentation below is for winston-telegram@2. Read the winston-telegram@1.x documentation.

Usage

const logger = require('winston')
const TelegramLogger = require('winston-telegram')

// or
import TelegramLogger from 'winston-telegram';

logger.add(new TelegramLogger(options))

Options:

  • token The Telegram bot authentication token. [required]
  • chatId The Telegram chatid you want to send to. [required]
  • messageThreadId The Telegram unique identifier of a message thread to which the message belongs. [optional]
  • parseMode The Telegram mode for parsing entities in the message text. See formatting options for more details. [optional]
  • level Level of messages that this transport should log. [optional] [default info]
  • unique Whether to log only the declared level and none above. [boolean] [optional]
  • silent Whether to suppress output. [boolean] [optional]
  • disableNotification Sends the message silently. [boolean] [optional]
  • template Format output message. [string] [optional]
  • formatMessage Format output message by own method. [function] [optional]
  • handleExceptions Handle uncaught exceptions. [boolean] [optional]
  • batchingDelay Time in ms within which to batch messages together. [integer] [optional] [default 0 or disabled]
  • batchingSeparator String with which to join batched messages with [string] [default "\n\n"]

String template is based on named arguments:

'{level}' -> level of messages
'{message}' -> text of messages
'{metadata}' -> metadata object of messages

Examples

Follow below steps to run the examples:

$ git clone git@github.com:ivanmarban/winston-telegram.git -b master --single-branch
$ npm install

Replace TELEGRAM_TOKEN and CHAT_ID with appropiate values, then run whatever example you want:

$ node examples/default-logger.js

Keywords

FAQs

Package last updated on 06 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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