0.1.1 • Published 3 months ago

termux-notify v0.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
3 months ago

Termux Notify

Sending notifications from your project to Android notification center.


Table of Contents


Description

Nodejs module for Sending notifications from your project to Android notification center by using termux-notificationand termux-toast packges.


Requirements

  • Android Device.
  • Termux & Termux:API Apps.

Installation

  • Install Termux:API app from F-Droid app or from GitHub repository.
  • Make sure that Termux:API app have a permission to send notifications.

  • Install termux-notification and termux-toast packges from Termux;-

pkg install termux-api
  • Install TermuxNotify into your project:-

  • With npm

npm i termux-notify
  • With yarn
yarn add termux-notify
  • Add TermuxNotify to your project
const termux = require('termux-notify');

Quickstart

TermuxNotify exports only one function.

Simple way

termux('Notification Message');

Advanced way

termux({
  title: 'Notification Title',
  message: 'Notification message',
  image: 'assets/image.png', // You can use full path for image
}, function(err, log) {
  err && console.log(log);
});

You can use status instead of image to show simple colored icons

  • Status exampe:-
termux({
  title: 'Notification Title',
  message: 'Notification message',
  status: 'success', // accepted values:- 'success', 'info', 'warning', 'danger'
}, function(err, log) {
  err && console.log(log);
});

Toast messages:-

termux({
  message: 'Notification message',
  toast: true,
});

Contributing

Want to get involved with Termux Notify? Here's how you can help.

Fork TermuxNotify, clone your fork, and configure the remotes:

# Get code from repostery
git clone https://github.com/<your-username>/termux-notify.git

# Change your way to cloned directory
cd termux-notify

# Configure the remotes
git remote add upstream https://github.com/alzintani/termux-notify.git

Copyright and license

TermuxNotify 2024 Alzintani. Code released under the MIT license.

0.1.1

3 months ago

0.1.0

3 months ago