-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmemories.json
1 lines (1 loc) · 1.58 KB
/
memories.json
1
[{"id":1,"title":"Initiating a Phone Call Using Termux-API.","text":"REPL[ const phoneNumber = \"555-555-5555\"; termux.telephonyCall(phoneNumber).then(() => { termux.ttsSpeak(\"Initiating call to \" + phoneNumber); console.log(\"Call initiated to \" + phoneNumber); }); ]","category":"repl"},{"id":2,"title":"Create JSON object with 'batteryStatus' help output and save in file.","text":"REPL[ const batteryHelp = {}; termux.batteryStatus('-h').then(help => { batteryHelp['batteryStatus'] = help; fs.writeFileSync(\"termuxapi.json\", JSON.stringify(batteryHelp)) }) ]","category":"repl"},{"id":3,"title":"Turning on flashlight using Termux-api torch command in Node.js REPL","text":"REPL[ termux.torch('on').then(()=>{console.log('Flashlight turned on')}) ]","category":"repl"},{"id":4,"title":"Turning off torch using Termux-api.","text":"REPL[ try { termux.torch(\"off\").then(() => console.log('Torch turned off.')) } catch(e) { console.log('Error:',e) } ]","category":"repl"},{"id":5,"title":"Retrieving Data from File using Node.js REPL.","text":"REPL[console.log(fs.readFileSync('hello.txt', 'utf8'))]","category":"repl"},{"id":6,"title":"Using Termux-api and Node.js REPL to Speak Battery Status","text":"REPL[ try { termux.batteryStatus().then((status) => { status=JSON.parse(status); let stats = \"The current battery status is \" + status[\"health\"] + \", \" + status[\"percentage\"] + \" percent.\"; console.log(stats);}) } catch(e) { console.log('Error: ',e ) } ]","category":"repl"},{"id":9,"title":"Setting Screen Brightness with Termux-API","text":"REPL[ termux.brightness(1) ]","category":"repl"}]