Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

termux-api-library

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

termux-api-library

Termux-api library for NodeJS

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
decreased by-37.5%
Maintainers
1
Weekly downloads
 
Created
Source

termux-api-library


Termux-API library for NodeJS

install

  • Make sure you've first installed the termux and termux-api on your Android device from the f-droid or github releases.

  • To use Termux:API you also need to install the termux-api package.

pkg install termux-api
  • Finally get this node library
npm i --save termux-api-library

Example usage

import api from 'termux-api-library';

await api.termux_battery_status((e) => {
    console.log(e);
});
import api from 'termux-api-library';

await api.termux_brightness(255);
import api from 'termux-api-library';

await api.termux_call_log(10, (e) => {
    console.log(e);
})
import api from 'termux-api-library';

await api.termux_camera_info((e) => {
   console.log(e);
})
import api from 'termux-api-library';

await api.termux_camera_photo(0, './test.jpeg');
import api from 'termux-api-library';

await api.termux_clipboard_get((e) => {
   console.log(e);
})
import api from 'termux-api-library';

await api.termux_clipboard_set("hello world")
import api from 'termux-api-library';

await api.termux_contact_list((e) => {
   console.log(e);
})
import api from 'termux-api-library';

const hint = 'Put your password here'
const title = 'input password'

await api.termux_dialog(hint, title, false, true, true, (e) => {
   console.log(e);
})
  • termux-download Download a files
import api from 'termux-api-library';

const url = 'https://example.com/image.jpeg'
const filename = 'photo_2022'
const savePath = '/data/data/com.termux/files/home'

await api.termux_download(url, filename, savePath);
import api from 'termux-api-library';

await api.termux_fingerprint((e) => {
   console.log(e);
})
import api from 'termux-api-library';

await api.termux_location("gps", "once", (e) => {
   console.log(e);
})

or

const data = await api.termux_location('gps', 'once')
console.log(data);
import api from 'termux-api-library';

const info = await api.termux_media_player.info();
console.log(info);

const play = await api.termux_media_player.play();
console.log(play);

const playFile = await api.termux_media_player.playFile(path);
console.log(playFile);

const pause = await api.termux_media_player.pause();
console.log(pause);

const stop = await api.termux_media_player.stop();
console.log(stop);
import api from 'termux-api-library';

const info = await api.termux_microphone_record.info();
console.log(info);

const path = '/data/data/com.termux/files/home/filename.mp3'
const limit = 0
const start = await api.termux_microphone_record.start(path, limit);
console.log(start);

const stop = await api.termux_microphone_record.stop();
console.log(stop);

License

MIT license

FAQs

Package last updated on 22 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc