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

termux-api-wrapper

v1.1.4

Published

Node module for Termux-API

Downloads

8

Readme

termux-api-wrapper

NPM Version Dependency Status JavaScript Style Guide

Comprehensive Node.js module for Termux-API

Install

  1. Make sure you've first installed the termux-api on your Android device.

  2. Then install the scripts with apt install termux-api.

  3. Finally get this node module:

    $ npm install --save termux-api-wrapper

Example usage

const api = require('termux-api-wrapper')

if (!api.hasTermux) {
   console.error('Cannot init termux-api');
   process.exit(1)
}

api.dialog()
   .widget('spinner')
   .values(['One', 'Two'])
   .title('Select a number!')
   .run().then(console.log)

Available methods

Every command instance has the .run() method that must be used to execute the command. It always return a Promise (eventually with results).

| Method | Description | Parameters | |--------|-------------|-----------| | .toast() | Show a toast message | | | | set the text to show | .text(<str>) | | | show the toast for a short while | .transient() | | .vibrate() | Vibrate your phone | | | | set the duration in milliseconds | .duration(<ms>) | | | force vibration even in silent mode | .force() | | .batteryStatus() | Get the status of the device battery | | | .cameraInfo() | Get info about device camera(s) | | | .cameraPhoto() | Take a photo and save it to a file (JPEG format) | | | | select the camera by ID | .camera(<id>) | | | output photo file (NB. use an absolute path!) | .outputFile(<str>) | | .clipboardGet() | Get the system clipboard text | | | .clipboardSet() | Set the system clipboard text | | | | text to copy in clipboard | .text(<str>) | | .contactList() | Set the system clipboard text | | | .contactList() | List all contacts | | | .dialog() | Show a text entry dialog | | | | dialog title | .title(<str>) | | | hint to show when input is empty | .hint(<str>) | | | use a textarea with multiple lines | .multipleLines() | | | enter the input as a password | .password() | | .download() | Download a resource using the download manager | | | | set the resource to download | .url(<str>) | | | title for the download request | .title(<str>) | | | description for the download request | .description(<str>) | | .infraredFrequencies() | Query the infrared transmitter's supported carrier frequencies | | | .infraredTransmit() | Transmit an infrared pattern | | | | specify the pattern to transmit as array of numbers | .frequency(<Array>) | | .location() | Get the device location | | | | location provider (gps/network/passive) | .provider(<enum>) | | | kind of request to make (once/last/updates) | .request(<enum>) | | .notification() | Display a system notification | | | | notification content to show | .content(<str>) | | | notification id (will overwrite any previous notification with the same id)| .id(<int>) | | | notification title to show | .title(<str>) | | | notification url when clicking on it | .url(<str>) | | | notification action when clicking on button1 | .button1(<str>, <str>) | | | notification action when clicking on button2 | .button2(<str>, <str>) | | | notification action when clicking on button3 | .button3(<str>, <str>) | | | notification action when tapping on it | .tap(<str>) | | | notification action when deleting it | .delete(<str>) | | | notification image to show | .image(<path>) | | | makes notification unremovable, need .id | .pin() | | .share() | share a file specified as argument | | | | provide a file to share | .file(<path>) | | | which action to perform on the file (edit/send/view) | .action(<enum>) | | | content-type to use (default: guessed from file extension) | .contentType(<str>) | | | share to the default receiver instead of showing a chooser | .default() | | | title to use for shared content (default: shared file name) | .title(<str>) | | .smsInbox() | List received SMS messages | | | | show dates when messages were created | .date() | | | limit in sms list (default: 10) | .limit(<int>) | | | show phone numbers | .showNumbers() | | | offset in sms list (default: 0) | .offset(<int>) | | .smsSend() | Send a SMS message to the specified recipient number(s) | | | | Recipient number(s), gotta be an Array | .numbers(<Array>) | | | The SMS text | .text(<str>) | | .telephonyCellInfo() | Get information about all observed cell information from all radios on the device | | | .telephonyDeviceInfo() | Get information about the telephony device | | | .ttsEngines() | Get information about the available text-to-speech (TTS) engines | | | .ttsSpeak() | Speak text with a system text-to-speech (TTS) engine | | | | Text to speak, passed to the engine | .text(<str>) | | | TTS engine to use, see .ttsEngines() | .engine(<id>) | | | language to use (may be unsupported by the engine) | .language(<enum>) | | | pitch to use in speech (1.0 is normal) | .pitch(<num>) | | | speech rate to use (1.0 is normal) | .rate(<num>) | | | audio stream to use (ALARM/MUSIC/NOTIFICATION/RING/SYSTEM/VOICE_CALL) | .stream(<enum>) |

Dependency

It uses has-termux-api to check if termux-api is installed.

Debug

Set the env DEBUG: DEBUG=termux

License

MIT