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

screen-flow

v1.0.2

Published

Navigation intelligence library for React and React Native

Readme

screen-flow 🧭

Navigation intelligence, not just analytics. One-stop, platform-agnostic tracker for React and React Native.

license size tests


🚀 Why ScreenFlow?

In a world of bloated analytics SDKs (Segment, Firebase, Mixpanel), ScreenFlow is the minimalist's choice.

  • ⚡ Zero Bloat: Only a few KB. Won't slow down your app or increase your bundle size like 2MB+ commercial SDKs.
  • 🛡️ Privacy First: No data ever leaves the device unless you want it to. Total control over your user's privacy.
  • 📱 True Cross-Platform: Write once, track everywhere. Same API for Web and React Native with automatic lifecycle detection.
  • 🧠 More than Counters: Automatically tracks duration, maintains history, and detects back-navigation using smart algorithms.
  • 💾 Persistence Ready: Unlike other lightweight trackers, ScreenFlow can persist data across app restarts.
  • 🧪 100% Transparent: Open-source and fully covered by unit tests. No "black-box" tracking.

✨ Features

  • 🔄 Flow Tracking: Keeps track of the last 30 screens visited.
  • ⏱️ Time Awareness: Automatically tracks time spent on each screen.
  • 🔙 Smart Back Detection: Detects back navigation even across multiple screens.
  • ⏸️ Smart Pausing: Pauses timers when the app is in background.
  • ⚛️ React Ready: Comes with first-class hooks like useScreenFlow.
  • 🔌 Adapter Pattern: Send data to Console, Firestore, Segment, or your own API.

🚀 Installation

npm install screen-flow

⚙️ Quick Start

1. Initialize (Optional but recommended)

Setup your storage and output adapter.

import { initScreenFlow, ConsoleAdapter } from 'screen-flow';

initScreenFlow({
  adapter: new ConsoleAdapter(),
  // Persistence for Web (localStorage) or React Native (AsyncStorage)
  storage: localStorage, 
  sessionTimeout: 30 * 60 * 1000 // 30 mins
});

2. Track Screens

⚛️ Functional Components (React)

import { useScreenFlow } from 'screen-flow';

const Dashboard = () => {
  useScreenFlow('Dashboard', { tab: 'overview' });
  return <div>My Dashboard</div>;
};

🖱️ Manual Tracking

import { onScreenChange } from 'screen-flow';

// Anywhere in your logic
await onScreenChange('Settings');

🔌 Customizing Output (Adapters)

Connect ScreenFlow to any service in seconds.

import { Adapter, ScreenEvent } from 'screen-flow';

class MyBrandAdapter implements Adapter {
  onEvent(event: ScreenEvent) {
    console.log(`User stayed on ${event.previousScreen} for ${event.duration}ms`);
    // Send to your own server
    myApi.log(event);
  }
}

📄 Screen Event Data Structure

| Property | Type | Description | | :--- | :--- | :--- | | screen | string | Current screen name | | previousScreen | string \| null | Name of the last screen | | duration | number | Time spent on the last screen (ms) | | flow | string[] | Last 30 screens visited | | isBack | boolean | True if this move was a "Back" navigation | | sessionId | string | Unique, persistent session ID | | params | object | Custom metadata provided by you |


💖 Support

If ScreenFlow saved you hours of work or helped you build a faster app, consider supporting the development!


🛡️ License

ISC (Free and Open Source)