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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sosweetham/tauri-plugin-torch-api

v0.1.0

Published

A simple flash/torch control plugin for Tauri applications.

Downloads

4

Readme

Tauri Plugin Torch

This project is a Tauri plugin which allows for flash control on iOS and Android devices with a consistent API.

| Platform | Supported | | -------- | --------- | | Linux | x | | Windows | x | | macOS | x | | Android | ✓ | | iOS | ✓ |

API

Available Commands

import { ping, toggle, check } from "@sosweetham/tauri-plugin-torch-api";
async function toggleTorch() {
    const isTorchOn = await check();
    if (isTorchOn) {
        await toggle(false);
        updateResponse("Torch is off");
    } else {
        await toggle(true);
        updateResponse("Torch is on");
    }
}

async function onTorch() {
    toggle(true).then(updateResponse).catch(updateResponse);
}

async function offTorch() {
    toggle(false).then(updateResponse).catch(updateResponse);
}

Default Permission

This permission set configures which torch features are by default exposed.

Granted Permissions

It allows access to all torch commands.

This default permission set includes the following:

  • allow-toggle
  • allow-check

Permission Table

torch:allow-check

Enable the check command.

torch:deny-check

Disable the check command.

torch:allow-toggle

Enable the toggle command.

torch:deny-toggle

Disable the toggle command.

Contribution

Notes

  1. Ping command is boilerplate code, ignore it, I kept it in the reference, might remove later.
  2. Permission tomls had to be added manually to ./permissions/autogenerated/commands, contrary to what the tauri documentation says.
  3. Be sure to deploy the app using pnpm tauri [android|ios] dev to get the best experience. The IDEs are not aware of the Tauri build process and will not work as expected.
  4. Do it beforehand development because otherwise tauri packages will not be generated for the swift and kotlin code.

Development Troubleshooting

  • Be sure to open the android and ios folders in their respective IDEs (Android Studio and XCode) to get the best development experience.
  • Do not deploy the app using the buttons provided in the IDEs, use the Tauri CLI instead. The IDEs are not aware of the Tauri build process and will not work as expected.
  • You must build the plugin and guest-js before deploying the app using cargo build and pnpm build respectively.
  • The tauri imports may give import errors in the IDEs if you dont use the plugin and deploy the app first.

Looking for

  • Automated Testing Suite - Implementation for testing suite of the plugin would be highly appreciated
  • Documentation - Doc comments are lackluster rn for a library project

Physical Testing

I have tested the plugin on a Pixel 8 Pro (Android 15) and iPhone 13 (iOS 18) and it works as expected. The implementations are really generic and should work on all devices. If you have a device that is not working, please open an issue.