UNPKG

@dderevjanik/termux-api

Version:

This library allows you to interact with your Android device from Node.js using termux-api

24 lines (23 loc) 776 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.telephonyCellInfo = telephonyCellInfo; const child_process_1 = require("child_process"); /** * Call a telephony number */ async function telephonyCellInfo() { return new Promise((resolve, reject) => { const command = `termux-telephony-cellinfo`; (0, child_process_1.exec)(command, (error, stdout, stderr) => { if (error) { return reject(`Error: ${error.message}`); } if (stderr) { return reject(`Error: ${stderr}`); } const output = stdout.trim(); const cameraCapabilities = JSON.parse(output); return resolve(cameraCapabilities); }); }); }