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 🙏

© 2025 – Pkg Stats / Ryan Hefner

szutils.vue

v0.0.15

Published

A modular Vue 3 composables collection designed for reactive productivity, time tracking, habit building, and Firebase integration. Each utility is independently packaged, documented, and demo-ready with comprehensive TypeScript support.

Downloads

22

Readme

szutils.vue

A modular Vue 3 composables collection designed for reactive productivity, time tracking, habit building, and Firebase integration. Each utility is independently packaged, documented, and demo-ready with comprehensive TypeScript support.

🔧 Built with Vite + TypeScript
📦 Published as ESM & UMD on npm and CDN 🎯 Lightweight and reactive Vue composables 🔥 Firebase integration with authentication & real-time sync

🚀 Quick Start & Demo

To run the interactive demo app and explore all composables:

# Install dependencies in root
npm install

# Navigate to the demo app
cd lab/vite

# Install demo app dependencies
npm install

# Start the demo app
npm run dev

The demo app showcases all composables with interactive examples and live code demos.


📚 Utilities

1. useDuration

A reactive Luxon-based stopwatch/timer with real-time tracking support.
✅ Features run(), stop(), reset(), and elapsed tracking with isRunning status.


2. useDurationDisplay

Format and display durations in a readable way with renderless components.
✅ Converts milliseconds or Luxon durations to human-friendly strings.
✅ Includes renderless Vue components for flexible duration display in templates.


3. useTimeTracker

Track how much time has been spent doing something — session-by-session or continuously.
✅ Entries, streaks, grouping by day/week/month, and total duration.


4. useHabitTracker

A powerful daily/weekly/monthly habit tracker with goal setting, breaks, off-days, and personal best tracking.
✅ Tracks reps per day, calculates pass/success, off/break days, streaks, and supports localStorage persistence.

Demos:

  • entries.vue — record reps, diary view
  • settings.vue — goal/offday/break configuration
  • dashboard.vue — summary of performance

5. useMetas

Reactive metadata management for composables and utilities.
✅ Store, update, and retrieve meta info for tracking and display.


6. useTimer

Simple interval-based timer composable.
✅ Start, stop, reset, and tick events for periodic actions.


7. useTimeTick

Reactive ticking composable for time-based updates.
✅ Emits ticks at specified intervals for UI refresh or polling.


8. useTimeTickShared

Shared ticking composable for global time updates across components.
✅ Centralized tick source for synchronized updates.


9. useFirebaseDb

Firebase Firestore database integration with complete authentication suite.
✅ Email/password authentication, Google OAuth, multi-project configuration.
✅ Reactive user state, automatic session management, and Firebase app switching.


10. useFirebaseDoc

Reactive Firestore document management with real-time synchronization and callbacks.
✅ Document CRUD operations, real-time updates via onSnapshot, dynamic document switching.
onUpdate callbacks for reactive data handling, multi-project support, TypeScript integration.


11. useFirebaseDocListener

Efficient Firestore document listener with global deduplication and memory management.
✅ Prevents duplicate listeners for the same document across components.
✅ Automatic cleanup, shared data updates, and optimized Firebase reads for performance.


12. generateId

Utility function to generate unique IDs.
✅ Useful for keys, tracking, and dynamic lists.


📁 Project Structure

src/
├─ composables/
│   ├─ useDuration/
│   ├─ useDurationDisplay/
│   │   ├─ index.ts
│   │   ├─ component.ts        # Renderless components
│   │   ├─ README.md
│   │   └─ Demo.vue
│   ├─ useTimeTracker/
│   ├─ useHabitTracker/
│   │   ├─ index.ts
│   │   ├─ README.md
│   │   ├─ Demo.vue
│   │   ├─ demos/
│   │   │   ├─ entries.vue
│   │   │   ├─ settings.vue
│   │   │   └─ dashboard.vue
│   ├─ useMetas/
│   ├─ useTimer/
│   ├─ useTimeTick/
│   ├─ useTimeTickShared/
│   ├─ useFirebaseDb/
│   │   ├─ index.ts
│   │   ├─ README.md
│   │   └─ Demo.vue
│   ├─ useFirebaseDoc/
│   │   ├─ index.ts
│   │   ├─ README.md
│   │   └─ Demo.vue
│   └─ useFirebaseDocListener/
│       ├─ index.ts
│       └─ README.md
├─ utility/
└─ components/
    └─ FormModal.vue           # Reusable form modal component

Each utility folder is self-contained with its own:

  • index.ts (main logic with TypeScript support)
  • README.md (comprehensive documentation)
  • Demo.vue (interactive demo)
  • component.ts (renderless components, where applicable)
  • demos/ folder (use-case demos, if needed)

📦 Installation

npm install szutils.vue

For Firebase composables, also install Firebase:

npm install firebase

Or use via CDN:

<script src="https://unpkg.com/szutils.vue"></script>

📄 License

MIT


🙌 Contributions

Contributions are welcome! Open an issue or submit a PR with ideas, improvements, or new utilities.