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

@rt-tools/core

v0.3.1

Published

Core utilities for Angular applications - MessageBus, PlatformService, WINDOW token, and helper functions

Readme

@rt-tools/core

npm Angular License

Everything in the rt-tools workspace that needs Angular but is not a UI component: directives, pipes, validators, platform and breakpoint services, storage, a message bus and the BEM helpers the kit's templates are built on.

@rt-tools/store and @rt-tools/ui-kit build on it. The framework-free half — pure functions, list models, type helpers — lives in @rt-tools/utils, which this package depends on. Neither re-exports the other: isNil and INullable are imported from @rt-tools/utils, always.

Installation

pnpm add @rt-tools/core
# or
npm install @rt-tools/core

@rt-tools/utils comes along as a dependency.

Setup

import { provideRtUtils, provideRtStorage, provideRtIDBStorage } from '@rt-tools/core';

bootstrapApplication(RootComponent, {
    providers: [
        provideRtUtils(), // BreakpointService + PlatformService
        provideRtStorage(), // local / session / in-memory storage
        provideRtIDBStorage(), // IndexedDB storage
    ],
});

What is in it

Services

import { BreakpointService, DeviceDetectorService, PlatformService, MessageBus } from '@rt-tools/core';

const breakpoints = inject(BreakpointService); // isMobile / isDesktop
const device = inject(DeviceDetectorService); // OS and device detection
const platform = inject(PlatformService); // isPlatformBrowser / isPlatformServer

MessageBus is a small typed event bus over RxJS — the same one @rt-tools/store dispatches through:

const bus = new MessageBus<'USER_LOGGED_IN' | 'USER_LOGGED_OUT'>();

bus.ofType('USER_LOGGED_IN').subscribe(() => {});
bus.emit({ type: 'USER_LOGGED_IN' });

Storage

StorageService behind an injection token per backing store, with a pluggable converter (JsonConverter by default), plus an IndexedDB service:

import { StorageService, LOCAL_STORAGE, SESSION_STORAGE, IN_MEMORY_STORAGE, IDBStorageService } from '@rt-tools/core';

const storage: StorageService = inject(LOCAL_STORAGE);
storage.setItem('key', { any: 'value' });

IN_MEMORY_STORAGE is the fallback when the platform has no Window, so server-side rendering keeps working instead of throwing.

Directives

import {
    RtIconOutlinedDirective, // Material Symbols outlined weight
    RtScrollToElementDirective,
    RtScrollDirective,
    RtNavigationDirective,
    RtTabQueryParamDirective, // tab index ↔ query parameter
    RtEscapeKeyDirective,
} from '@rt-tools/core';

Pipes

import {
    BreakStringPipe, // camelCase → readable
    SanitizePipe,
    EntityToStringPipe,
    EmptyToDashPipe,
    EqualPipe,
    EqualChainPipe,
    NotEqualPipe,
    NotEqualChainPipe,
    TernaryPipe,
    IsEmailPipe,
} from '@rt-tools/core';
{{ 'camelCaseString' | breakString }} {{ htmlContent | sanitize }} {{ condition | ternary: 'yes' : 'no' }}

Validators

import { emailValidator, checkIsMatchingValues, arraysNotEmptyValidator } from '@rt-tools/core';

new FormControl('', [emailValidator]);
new FormGroup({ password, confirm }, { validators: checkIsMatchingValues('password', 'confirm') });

BEM

The directives every rtui-* template uses to build class names, and what the kit's own lint rule expects instead of hand-written class strings:

import { BlockDirective, ElemDirective, ModDirective } from '@rt-tools/core';
<div rtBlock="card">
    <div rtElem="title" [rtMod]="{ compact: true }">…</div>
</div>

Tokens and helpers

import { WINDOW, NAVIGATOR, OVERLAY_POSITIONS, POSITION_ENUM, isHTMLElement } from '@rt-tools/core';

const win = inject(WINDOW); // safe on the server

Requirements

| Requirement | Version | | ----------------- | --------- | | Angular | ^22.0.0 | | RxJS | ^7.8.0 | | @rt-tools/utils | ^0.2.0 |

@angular/cdk, common, core, forms, platform-browser and router are peer dependencies.

License

Apache-2.0 © Yauheni Krumin