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

ng-route-logger

v0.0.7

Published

**ng-route-logger** is a simple and powerful Angular library that helps you **track page navigation times** inside your Angular application.

Downloads

8

Readme

📦 ng-route-logger

ng-route-logger is a simple and powerful Angular library that helps you track page navigation times inside your Angular application.

Whenever a user switches from one route (page) to another, this library records:

  • 📍 The new page’s URL (like /home, /about)
  • ⏱️ How many milliseconds it took to load that page

This is super useful if you're building a fast Angular app and want to know which routes take longer to load.


🎯 Why Should You Use It?

✅ Simple to set up
✅ Works with Angular's built-in router
✅ Uses RxJS Observables, so you can subscribe to live logs
✅ Helpful for developers, testers, and learners


📦 Installation

Run this command in your Angular project folder:

npm install ng-route-logger

🧰 Having Trouble Installing?

If you're facing issues while installing (like cache or permission problems), you can force the install using:

npm install ng-route-logger --force

🛠️ How to Use

1. Import the Module

In your app.module.ts, import the logger module:

import { NgRouteLoggerModule } from 'ng-route-logger';

@NgModule({
  imports: [
    NgRouteLoggerModule,  // Add this line
    ...
  ],
})
export class AppModule {}

2. Use the Logger Service

You can inject the logger service into any component or service like this:

import { NgRouteLoggerService } from 'ng-route-logger';

constructor(private logger: NgRouteLoggerService) {
  this.logger.getLogs()
}

📚 Example Log Output

[
  { route: '/home', loadTime: 96.3 },
  { route: '/about', loadTime: 201.7 },
  { route: '/contact', loadTime: 87.2 }
]

📚 Example Use Cases

  • Show a "page load time" chart for users

  • Find out which pages take longest to load

  • Log page transitions for debugging or performance testing

🔍 What’s Happening in the Background?

  • ⏱️ Starts timer when route navigation begins (NavigationStart)
  • 🛑 Stops timer when navigation ends (NavigationEnd)
  • 🧾 Logs the route and time taken
  • 📡 Streams the logs using RxJS Observable

📬 Contribute or Report Issues

Found a bug or have an idea? Create an issue or PR at:

👉 https://github.com/souravion/ng-route-logger

🚀 Planned Features (Coming Soon)

Here are some awesome features we plan to add in future updates:

| Feature | Description | |------------------------------------|-----------------------------------------------------------------------------| | 📊 Route Load Time Charts | Visualize navigation performance using simple charts (e.g., bar or line) | | 💾 Export Logs | Export route logs as JSON or CSV files for performance audits | | 🎛️ Configurable Logging Options | Enable/disable specific logs or exclude certain routes | | 🧹 Auto-Cleanup | Automatically limit stored logs to the last N entries | | 🔥 DevTools Panel Integration | Optional integration with browser devtools extension for real-time viewing | | 🧪 Unit Test Utilities | Helpers to test routing performance in unit/e2e test suites | | 🌐 Multi-Tab Session Awareness | Detect and separate logs from different browser tabs |

✨ Have an idea or feature request? Feel free to open an issue or start a discussion!

✨ Made with ❤️ by Souravion

For Angular developers who want to know how fast their app really is.

-- Thanks & Regards, Sourav Halder Email: [email protected]