Package Exports
- termux-notify
- termux-notify/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (termux-notify) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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-notificationandtermux-toastpackges from Termux;-
pkg install termux-apiInstall 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.gitCopyright and license
TermuxNotify 2024 Alzintani. Code released under the MIT license.