{"id":16760359,"url":"https://github.com/roccomuso/termux","last_synced_at":"2025-04-09T19:18:45.746Z","repository":{"id":57376734,"uuid":"103532979","full_name":"roccomuso/termux","owner":"roccomuso","description":"Node.js module for Termux-API","archived":false,"fork":false,"pushed_at":"2020-10-19T21:26:21.000Z","size":43,"stargazers_count":167,"open_issues_count":1,"forks_count":21,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-09T19:18:41.791Z","etag":null,"topics":["android","api","js","node","nodejs","termux","wrapper"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roccomuso.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-14T13:03:09.000Z","updated_at":"2025-03-27T23:22:19.000Z","dependencies_parsed_at":"2022-09-02T16:28:33.698Z","dependency_job_id":null,"html_url":"https://github.com/roccomuso/termux","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roccomuso%2Ftermux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roccomuso%2Ftermux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roccomuso%2Ftermux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roccomuso%2Ftermux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roccomuso","download_url":"https://codeload.github.com/roccomuso/termux/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248094990,"owners_count":21046770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","api","js","node","nodejs","termux","wrapper"],"created_at":"2024-10-13T04:23:15.261Z","updated_at":"2025-04-09T19:18:45.719Z","avatar_url":"https://github.com/roccomuso.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# termux\n\n[![NPM Version](https://img.shields.io/npm/v/termux.svg)](https://www.npmjs.com/package/termux)\n[![Dependency Status](https://david-dm.org/roccomuso/termux.png)](https://david-dm.org/roccomuso/termux)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\n\u003e Comprehensive Node.js module for [Termux-API](https://wiki.termux.com/wiki/Termux:API)\n\n## Install\n\n1. Make sure you've first installed the [termux-api](https://play.google.com/store/apps/details?id=com.termux.api) on your Android device from the Play store.\n2. Then install the scripts with `apt install termux-api`.\n3. Finally get this node module:\n\n    $ `npm install --save termux`\n\n## Example usage\n\n```javascript\nconst api = require('termux')\n\nif (!api.hasTermux) process.exit(1)\n\napi.vibrate()\n   .duration(1000)\n   .run()\n\napi.clipboardGet()\n   .run()\n   .then(function (text) {\n     // ...\n   })\n```\n\n## Available methods\n\nEvery command instance has the `.run()` method that must be used to execute the command. It always return a Promise (eventually with results).\n\n\n| Method | Description | Parameters |\n|--------|-------------|-----------|\n| `.toast()` | Show a toast message | |\n| | set the text to show | `.text(\u003cstr\u003e)` |\n| | show the toast for a short while | `.transient()` |\n| `.vibrate()` | Vibrate your phone | |\n| | set the duration in milliseconds | `.duration(\u003cms\u003e)` |\n| | force vibration even in silent mode | `.force()` |\n| `.batteryStatus()` | Get the status of the device battery | |\n| `.cameraInfo()` | Get info about device camera(s) | |\n| `.cameraPhoto()` | Take a photo and save it to a file (JPEG format) | |\n| | select the camera by ID | `.camera(\u003cid\u003e)` |\n| | output photo file (NB. use an absolute path!) | `.outputFile(\u003cstr\u003e)` |\n| `.clipboardGet()` | Get the system clipboard text | |\n| `.clipboardSet()` | Set the system clipboard text | |\n| | text to copy in clipboard | `.text(\u003cstr\u003e)` |\n| `.contactList()` | Set the system clipboard text | |\n| `.contactList()` | List all contacts | |\n| `.dialog()` | Show a text entry dialog | |\n| | dialog title | `.title(\u003cstr\u003e)` |\n| | hint to show when input is empty | `.hint(\u003cstr\u003e)` |\n| | use a textarea with multiple lines | `.multipleLines()` |\n| | enter the input as a password | `.password()` |\n| `.download()` | Download a resource using the download manager | |\n| | set the resource to download | `.url(\u003cstr\u003e)` |\n| | title for the download request | `.title(\u003cstr\u003e)` |\n| | description for the download request | `.description(\u003cstr\u003e)` |\n| `.infraredFrequencies()` | Query the infrared transmitter's supported carrier frequencies | |\n| `.infraredTransmit()` | Transmit an infrared pattern | |\n| | specify the pattern to transmit as array of numbers | `.frequency(\u003cArray\u003e)` |\n| `.location()` | Get the device location | |\n| | location provider (gps/network/passive) | `.provider(\u003cenum\u003e)` |\n| | kind of request to make (once/last/updates) | `.request(\u003cenum\u003e)` |\n| `.notification()` | Display a system notification | |\n| | notification content to show | `.content(\u003cstr\u003e)` |\n| | notification id (will overwrite any previous notification with the same id)| `.id(\u003cint\u003e)` |\n| | notification title to show | `.title(\u003cstr\u003e)` |\n| | notification url when clicking on it | `.url(\u003cstr\u003e)` |\n| | notification action when clicking on button1 | `.button1(\u003cstr\u003e, \u003cstr\u003e)` |\n| | notification action when clicking on button2 | `.button2(\u003cstr\u003e, \u003cstr\u003e)` |\n| | notification action when clicking on button3 | `.button3(\u003cstr\u003e, \u003cstr\u003e)` |\n| | notification action when tapping on it | `.tap(\u003cstr\u003e)` |\n| | notification action when deleting it | `.delete(\u003cstr\u003e)` |\n| | notification image to show | `.image(\u003cpath\u003e)` |\n| | makes notification unremovable, need .id  | `.pin()` |\n| `.share()` | share a file specified as argument | |\n| | provide a file to share | `.file(\u003cpath\u003e)` |\n| | which action to perform on the file (edit/send/view) | `.action(\u003cenum\u003e)` |\n| | content-type to use (default: guessed from file extension) | `.contentType(\u003cstr\u003e)` |\n| | share to the default receiver instead of showing a chooser | `.default()` |\n| | title to use for shared content (default: shared file name) | `.title(\u003cstr\u003e)` |\n| `.smsInbox()` | List received SMS messages | |\n| | show dates when messages were created | `.date()` |\n| | limit in sms list (default: 10) | `.limit(\u003cint\u003e)` |\n| | show phone numbers | `.showNumbers()` |\n| | offset in sms list (default: 0) | `.offset(\u003cint\u003e)` |\n| `.smsSend()` | Send a SMS message to the specified recipient number(s) | |\n| | Recipient number(s), gotta be an Array | `.numbers(\u003cArray\u003e)` |\n| | The SMS text | `.text(\u003cstr\u003e)` |\n| `.telephonyCellInfo()` | Get information about all observed cell information from all radios on the device | |\n| `.telephonyDeviceInfo()` | Get information about the telephony device | |\n| `.ttsEngines()` | Get information about the available text-to-speech (TTS) engines | |\n| `.ttsSpeak()` | Speak text with a system text-to-speech (TTS) engine | |\n| | Text to speak, passed to the engine | `.text(\u003cstr\u003e)` |\n| | TTS engine to use, see `.ttsEngines()` | `.engine(\u003cid\u003e)` |\n| | language to use (may be unsupported by the engine) | `.language(\u003cenum\u003e)` |\n| | pitch to use in speech (1.0 is normal) | `.pitch(\u003cnum\u003e)` |\n| | speech rate to use (1.0 is normal) | `.rate(\u003cnum\u003e)` |\n| | audio stream to use (ALARM/MUSIC/NOTIFICATION/RING/SYSTEM/VOICE_CALL) | `.stream(\u003cenum\u003e)` |\n\n\n## Dependency\n\nIt uses [has-termux-api](https://github.com/roccomuso/has-termux-api) to check if termux-api is installed.\n\n## Debug\n\nSet the env DEBUG: `DEBUG=termux`\n\n# Author\n\nRocco Musolino ([@roccomuso](https://twitter.com/roccomuso))\n\n# License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froccomuso%2Ftermux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froccomuso%2Ftermux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froccomuso%2Ftermux/lists"}