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

@flexzap/utilities

v1.2.0

Published

All the utilities that makes part of the flexzap library

Readme

@flexzap/utilities

Essential utility services and helpers for Angular applications. Part of the FlexZap Library ecosystem.

Installation

npm install @flexzap/utilities

Peer Dependencies

This library requires the following peer dependencies:

npm install @angular/common@^21.1.0 @angular/core@^21.1.0 @angular/platform-browser@^21.1.0

Usage

ZapNavigation

The ZapNavigation service provides safe, platform-agnostic navigation methods.

import { Component, inject } from '@angular/core';
import { ZapNavigation } from '@flexzap/utilities';

@Component({
  template: `
    <button (click)="goToExternal()">Go to Google</button>
    <button (click)="sendEmail()">Contact Us</button>
    <button (click)="callSupport()">Call Support</button>
  `
})
export class MyComponent {
  private navigation = inject(ZapNavigation);

  goToExternal() {
    // Safely navigates to URL (sanitized and browser-check included)
    this.navigation.goToUrl('https://google.com', '_blank');
  }

  sendEmail() {
    this.navigation.mailTo('[email protected]', 'Help', 'I need assistance');
  }

  callSupport() {
    this.navigation.callTo('+1234567890');
  }
}

API Reference

ZapNavigation Service

Service for handling navigation and URL opening in a safe, platform-agnostic way.

Methods

| Method | Parameters | Description | | -------------- | -------------------------------------------------------------------- | -------------------------------------------------------------- | | goToUrl | url: string, target?: '_self' \| '_blank' \| '_parent' \| '_top' | Navigates to the specified URL. Default target is _self. | | mailTo | email: string, subject?: string, body?: string | Opens the default email client with optional subject and body. | | callTo | tel: string | Initiates a phone call to the specified number. | | smsTo | tel: string | Initiates an SMS to the specified number. | | linkTo | id: string | Smoothly scrolls to the element with the specified ID. | | downloadFile | url: string, filename?: string | Downloads a file from the specified URL. |

Features

  • Platform Agnostic: Safe to call in SSR environments (checks PLATFORM_ID).
  • Security: Automatically sanitizes URLs to prevent XSS.
  • SSR Safe: Prevents window access on the server.

Testing

This library uses Jest for unit testing with zoneless Angular configuration.

Running Tests

# From the monorepo root
npm run utilities:test            # Run all unit tests with coverage
npm run utilities:test:watch      # Run tests in watch mode (no coverage)

Test Configuration

  • Framework: Jest with jest-preset-angular
  • Environment: jsdom
  • Configuration: Zoneless Angular (mandatory)
  • Coverage: Reports generated at coverage/flexzap/utilities/

Development

Building the Library

# From the monorepo root
npm run utilities:build       # Build directly
ng build @flexzap/utilities   # Build using Angular CLI

Publishing

Build for Publication

# From the monorepo root
npm run utilities:build

Publish to NPM

cd dist/flexzap/utilities
npm publish --access public

Contributing

This library is part of the FlexZap Library monorepo. Please refer to the main repository for contribution guidelines.

License

MIT License - see the LICENSE file for details.

Links