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

tauri-update-notifier

v0.1.0

Published

A lightweight update notification library for Tauri applications using GitHub Releases

Readme

tauri-update-notifier

A lightweight update notification library for Tauri applications using GitHub Releases.

Features

  • Zero dependencies - Core API has no external dependencies
  • React components - Ready-to-use notification component (optional)
  • Customizable - Full control over styling and behavior
  • TypeScript - Full type support
  • Tauri-optimized - Works seamlessly with @tauri-apps/plugin-shell

Installation

npm install tauri-update-notifier
# or
pnpm add tauri-update-notifier
# or
yarn add tauri-update-notifier

Usage

Core API (No React)

import { checkForUpdates } from 'tauri-update-notifier';

const update = await checkForUpdates({
  owner: 'your-github-username',
  repo: 'your-repo-name',
  currentVersion: '1.0.0',
});

if (update.isUpdateAvailable) {
  console.log(`New version available: ${update.latestVersion}`);
  console.log(`Download: ${update.releaseUrl}`);
}

React Component

import { UpdateNotification } from 'tauri-update-notifier/react';
import { open } from '@tauri-apps/plugin-shell';

function App() {
  return (
    <>
      <YourApp />
      <UpdateNotification
        owner="your-github-username"
        repo="your-repo-name"
        currentVersion="1.0.0"
        onOpenUrl={open} // Use Tauri's shell plugin to open URLs
      />
    </>
  );
}

React Hook

import { useUpdateChecker } from 'tauri-update-notifier/react';

function MyComponent() {
  const { updateInfo, isChecking, checkNow } = useUpdateChecker({
    owner: 'your-github-username',
    repo: 'your-repo-name',
    currentVersion: '1.0.0',
  });

  if (updateInfo?.isUpdateAvailable) {
    return (
      <div>
        New version {updateInfo.latestVersion} available!
        <a href={updateInfo.releaseUrl}>Download</a>
      </div>
    );
  }

  return <button onClick={checkNow}>Check for updates</button>;
}

API Reference

checkForUpdates(options)

Check for updates from GitHub Releases.

interface UpdateCheckerOptions {
  owner: string;           // GitHub owner (username or org)
  repo: string;            // Repository name
  currentVersion: string;  // Current app version (e.g., "1.0.0")
  includePrerelease?: boolean; // Include pre-releases (default: false)
}

interface UpdateInfo {
  currentVersion: string;
  latestVersion: string;
  isUpdateAvailable: boolean;
  releaseUrl: string;
  releaseNotes: string;
  publishedAt: string;
  assets: ReleaseAsset[];
}

<UpdateNotification />

React component for displaying update notifications.

interface UpdateNotificationProps {
  owner: string;
  repo: string;
  currentVersion: string;
  checkOnMount?: boolean;      // Check on mount (default: true)
  checkInterval?: number;      // Check interval in ms (default: 0 = disabled)
  includePrerelease?: boolean; // Include pre-releases (default: false)
  onOpenUrl?: (url: string) => void; // Custom URL opener
  onUpdateAvailable?: (info: UpdateInfo) => void;
  onError?: (error: Error) => void;
  position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
  styles?: UpdateNotificationStyles;
  classNames?: UpdateNotificationClassNames;
  render?: (props: UpdateNotificationRenderProps) => ReactNode;
}

useUpdateChecker(options)

React hook for checking updates.

const {
  updateInfo,    // Latest update info
  isChecking,    // Whether currently checking
  error,         // Last error
  checkNow,      // Manually trigger check
  dismissUpdate, // Dismiss current update
  clearDismissed,// Clear dismissed version
  isDismissed,   // Whether current update is dismissed
} = useUpdateChecker(options);

Customization

Custom Styles

<UpdateNotification
  owner="myorg"
  repo="myapp"
  currentVersion="1.0.0"
  styles={{
    container: { bottom: '2rem', right: '2rem' },
    card: { backgroundColor: '#fff', color: '#000' },
    downloadButton: { backgroundColor: '#007bff' },
  }}
/>

Custom Class Names (for Tailwind CSS)

<UpdateNotification
  owner="myorg"
  repo="myapp"
  currentVersion="1.0.0"
  classNames={{
    container: 'fixed bottom-4 right-4',
    card: 'bg-white shadow-lg rounded-lg',
    downloadButton: 'bg-blue-500 hover:bg-blue-600',
  }}
/>

Custom Render

<UpdateNotification
  owner="myorg"
  repo="myapp"
  currentVersion="1.0.0"
  render={({ updateInfo, onDownload, onSkipVersion }) => (
    <div className="my-custom-notification">
      <p>Version {updateInfo.latestVersion} available!</p>
      <button onClick={onDownload}>Download</button>
      <button onClick={onSkipVersion}>Skip</button>
    </div>
  )}
/>

Tauri Integration

For Tauri applications, use @tauri-apps/plugin-shell to open external URLs:

pnpm add @tauri-apps/plugin-shell
// src-tauri/src/lib.rs
pub fn run() {
    tauri::Builder::default()
        .plugin(tauri_plugin_shell::init())
        // ...
}
// src-tauri/capabilities/default.json
{
  "permissions": [
    "shell:allow-open"
  ]
}
import { open } from '@tauri-apps/plugin-shell';
import { UpdateNotification } from 'tauri-update-notifier/react';

<UpdateNotification
  owner="myorg"
  repo="myapp"
  currentVersion="1.0.0"
  onOpenUrl={open}
/>

Version Comparison

The library uses semantic versioning comparison:

import { compareVersions } from 'tauri-update-notifier';

compareVersions('1.0.0', '1.0.1'); // -1 (1.0.0 < 1.0.1)
compareVersions('2.0.0', '1.9.9'); //  1 (2.0.0 > 1.9.9)
compareVersions('v1.0.0', '1.0.0'); // 0 (equal, 'v' prefix handled)

License

MIT