New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

node-telegram-log

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-telegram-log

Node.js log sender to Telegram

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

Telegram Logger

Simple Telegram logger for node.js.

Install

$ npm install node-telegram-log

Prerequisites

  • Create telegram bot and get it's token:

  • Add bot to group or go to bot's page and /start

  • Get chat_id where bot will send messages. Feel free to use IDBot to get chat_id

Usage

const { TelegramLogger } = require('node-telegram-log');

const logger = new TelegramLogger(BOT_TOKEN_ID, CHAT_ID);

// Log some message
logger.log('Hooray! It works');
// Formatted message
/**
 * ℹ️ LOG
 *
 * Hooray! It works
 */

// Or debug
logger.debug('Just debugging it', { canILogObjects: true });

// Formatted message
/**
 * ⚙️ DEBUG
 *
 * Just debugging it
 * {
 *   "canILogObjects": true
 * }
 */

// Mention user, who must to pay attention to this message
// Note: @mentions work only if part of message starts with @username
logger.error('@joeberetta', 'Something went wrong:', [1, { formatted: true }, 'wow']);
// Formatted message
/**
 * 🆘 ERROR
 *
 * Something went wrong:
 * [1,{"formatted":true},"wow"]
 *
 * @joeberetta
 */

Author

Joe Beretta

License

Copyright © 2020, Joe Beretta. Released under the MIT License.

Keywords

node.js

FAQs

Package last updated on 28 Dec 2022

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