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-rutter

v1.0.10

Published

Angular Rutter API port

Readme

Unofficial Angular Rutter Link Port

Rutter Link Button for Angular; This is a simple wrapper for the javascript api that rutter provides. This is an unofficial npm package and is not endorsed or supported by Rutter. Source code is here

Installation

npm install ng-rutter --save

Usage

Import NgRutterModule

You need to import the NgRutterModule in the module of your app where you want to use it.

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';
import { NgRutterModule } from 'ng-rutter';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    NgRutterModule.forRoot({
      PUBLIC_API_KEY: 'MY_PUBLIC_API_KEY'
    })
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Use the ng-rutter selector

Place the ng-rutter and pass the an event handler to process the publicToken handled by rutter.

<ng-rutter (onSuccess)="onSuccess($event)"></ng-rutter>

Handle the token response in your component.

import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {

  onSuccess(token: string) {
    callBackendAPI(token)
  }
}

Inputs

| Name | Type | Description | Default | |-----------------|--------|--------------------------------|----------| | text | string | the button text | "Log In" | | backgroundColor | string | background color of the button | '#000' | | color | string | the button text color | '#FFF' |

Outputs

| Name | Returns | Description | |-----------|---------|---------------------------------| | onSuccess | string | User successfully authenticated | | onLoad | void | Rutter alert loaded | | onExit | void | Rutter alert exited |

Use the NgRutterService to load Rutter programmatically

If you don't like the styling of the out of the box button you can trigger the Rutter dialog programmatically using the NgRutterService. This allows you to style the rutter link button as you'd like.

<div (click)="openRutter()"> Custom Button </div>
import { OnInit } from '@angular/core';
import { NgRutterService, NgRutterEventType } from 'ng-rutter';

export class AppComponent {

  constructor(private rutterService: NgRutterService) {
    this.rutterService.observable.subscribe(event => {
      if (event.name === NgRutterEventType.SUCCESS) {
        console.log(event.data.token)
      }
      if (event.name === NgRutterEventType.LOAD) {
        
      }
      if (event.name === NgRutterEventType.EXIT) {
        
      }
    })
  }

  openRutter() {
    this.rutterService.open()
  }
}