npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

telegram-alert

v1.0.2

Published

$ sleep 5; talert

Downloads

5

Readme

telegram-alert

talert - это реализация знакомого пользователям ubuntu алиаса alert для удаленных серверов. Вы можете использовать его на удаленных серверах для получения уведомлений о завершении выполнения "долгих" команд через свой клиент телеграмма.

$ sleep 3; talert

Использование

Для работы вам потребуются:

  • bash
  • клиент telegram на любом устройстве

Для начала использования:

  1. Добавьте в свои контакты @talertBot
  2. Отправьте /login для регистрации и генерации bash функций
  3. Присланные функции добавьте в свой ~/.bashrc
  4. Обновите текущую bash сессию: source ~/.bashrc
  5. Протестируйте работу talert: sleep 3; talert

Локальное развертывание

Вам потребуются:

  • Сервер с белым ip
  • Установленный node.js и npm (приложение тестировалось на версии [email protected] и [email protected])
  • Собственный телеграм бот
  • Локальный конфигурационный файл в директории проекта configs/config.local.json

Шаги развертывания:

  1. Инструкция по установке node.js и npm: https://github.com/creationix/nvm
  2. Инструкция по созданию бота: https://core.telegram.org/bots
  3. Пример содержимого файла config.local.json:
{
  "botCtrl": {
    "token": "12923553:AAGbAfaAz25VkJ-RR1mox3fp5AFzWQDk",
    "publicAddress": "189.16.02.11:k{ httpCtrl.port }"
  },
  "httpCtrl": {
    "port": 11111
  }
}

Замечание: в поле publicAddress порт можно вписать явно. Это может потребоваться, если ваш сервис telegram-alert будет стоять за NAT и слушать порт, отличный от порта, принимающего соединения из мира.

После этого, находясь в корневой дирректории проекта, вам необходимо:

# установить зависимости
npm install
# протестировать проект
npm test
# запустить проект
# https://github.com/Unitech/pm2
npm i -g pm2
sudo mkdir -p /var/log/pm2/
sudo chown $USER:$USER /var/log/pm2/
pm2 start pm2/telegram-alert.json

Если все пройдет удачно, то у вас будет свой собственный телеграмм бот для отправки вам уведомлений.

License

MIT