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

@reforgium/internal

v2.0.6

Published

Hidden Reforgium foundation package for shared primitives, tokens, and infrastructure.

Readme

@reforgium/internal

npm version License: MIT

Shared infrastructure package for Reforgium Angular libraries.

  • foundation primitives belong here
  • feature semantics do not
  • legacy compatibility for angular-common-kit does not

@reforgium/internal is infrastructure for Reforgium packages and is not intended as a user-facing product package.

Install

internal is primarily consumed transitively by other @reforgium/* packages. Direct installation is possible for workspace and low-level internal use, but it is not the recommended first entrypoint for app code.

npm i @reforgium/internal

Public API

@reforgium/internal exports:

  • models
  • codecs
  • storage
  • tokens
  • utils

Models

Main model groups:

  • query.models.ts: SortToken, SortDirection, SortRule, SortInput, QueryArrayMode, QueryFieldModes, QueryParams, Query
  • transport.models.ts: RestMethods, PageableRequest, PageableResponse<T>, ErrorResponse
  • elements.ts: Direction, ElementRect, ElementSize, ElementPosition, ElementEdges
  • util.ts: AnyType, AnyDict, LiteralOf, ValueOf, Nullable, Nullish, NullableProps, OptionalExcept, RequiredExcept, Mutable, JSON helper types

Compatibility-only model surface:

  • components.ts: Appearance, SelectOption, SelectIconOption
  • api.ts: deprecated mixed facade kept for compatibility; prefer explicit query and transport types

Codecs

Main codec exports:

  • Serializer
  • SerializerFieldError
  • SerializerConfig
  • FieldConfig
  • SerializedType

These are shared bidirectional transform primitives used by statum and regula.

Storage

Main storage exports:

  • StorageInterface
  • StorageStrategy, StorageStrategyOptions
  • MemoryStorage
  • LocalStorage
  • SessionStorage
  • LruCache
  • storageStrategy(...)

Tokens

Language tokens:

  • SELECTED_LANG: InjectionToken<Signal<Langs>>
  • CHANGE_LANG: InjectionToken<(lang: Langs) => void>
  • TRANSLATION
  • REGISTER_LANG (multi-token)
  • BUILTIN_LANGS
  • provideLangs(...langs: string[])
  • Langs = BuiltInLangs | (string & {})

Theme/device/validation tokens:

  • SELECTED_THEME, CHANGE_THEME, Themes
  • CURRENT_DEVICE, Devices
  • VALIDATION_MESSAGES, ValidationMessages, ValidationErrorData: compatibility-only legacy validation token surface

Example:

import { provideLangs } from '@reforgium/internal';

export const appConfig = {
  providers: [provideLangs('de', 'fr')],
};

Utilities

Exported utilities:

  • web.utils.ts: downloadByBlob, downloadByUrl, copyText, base64ToBlob
  • timers.utils.ts: throttleSignal, debounceSignal
  • date.utils.ts: toDate, formatDate, formatToLocaledDate, parseToDate, parseToDatePeriod, isDatePeriod, reformatDateToISO
  • types.utils.ts: isNumber, isNullable, isObject, parseQueryArray, concatArray
  • format.utils.ts: formatToSpacedNumber, truncate
  • positions.utils.ts: getCorrectedPosition
  • available-height.utils.ts: getAvailableHeight
  • get-chained-value.utils.ts: getChainedValue
  • query.utils.ts: buildQueryParams, appendQueryParamsByMode, parseQueryParams, parseQueryParamsByMode, mergeQueryParams, makeQuery
  • sort.utils.ts: toSortToken, sortRuleToToken, parseSortToken, normalizeSortInput, sortInputToTokens
  • urls.utils.ts: normalizeUrl, fillUrlWithParams, appendQueryParams, parseQueryParams
  • routes.utils.ts: materializeRoutePath, compareRoutes, makeQuery
  • deep-equal.utils.ts: deepEqual
  • generate.utils.ts: generateId

Recommended entrypoints:

  • prefer query.utils.ts for new query-string work;
  • prefer sort.utils.ts for new sort serialization/parsing work;
  • keep urls.utils.ts and routes.utils.ts for narrower low-level cases.

query.utils.ts example:

import { buildQueryParams, mergeQueryParams, parseQueryParamsByMode } from '@reforgium/internal';

const query = buildQueryParams(
  {
    tags: ['angular', 'signals'],
    sort: ['name,asc', 'createdAt,desc'],
    page: 2,
  },
  'comma',
  { sort: 'multi' },
);
// tags=angular%2Csignals&page=2&sort=name%2Casc&sort=createdAt%2Cdesc

const next = mergeQueryParams(
  { page: 1, tags: ['angular'], tenant: 'kg' },
  { page: 2, tenant: null, sort: ['name,asc'] },
);
// { page: 2, tags: ['angular'], sort: ['name,asc'] }

const parsed = parseQueryParamsByMode(query, 'comma', { sort: 'multi' });
// { tags: ['angular', 'signals'], sort: ['name,asc', 'createdAt,desc'], page: '2' }

sort.utils.ts example:

import { parseSortToken, sortInputToTokens, toSortToken } from '@reforgium/internal';

toSortToken('name', 'asc');
// 'name,asc'

sortInputToTokens([
  { sort: 'name', order: 'asc' },
  { sort: 'createdAt', order: 'desc' },
]);
// ['name,asc', 'createdAt,desc']

parseSortToken('createdAt,desc');
// { sort: 'createdAt', order: 'desc' }

Low-level makeQuery(..., 'multi') behavior:

import { makeQuery } from '@reforgium/internal';

makeQuery({ ids: [1, 2, 3], q: 'ok' }, 'multi');
// ids=1&ids=2&ids=3&q=ok

storage example:

import { LruCache, storageStrategy } from '@reforgium/internal';

const pages = new LruCache<number, string[]>(5);
pages.set(1, ['a', 'b']);

const persisted = storageStrategy<string, { updatedAt: number }>('persist');
persisted.set('users', { updatedAt: Date.now() });

codecs example:

import { Serializer } from '@reforgium/internal';

const serializer = new Serializer<{
  search: string;
  createdAt: Date;
}>({
  mapFields: {
    createdAt: { type: 'date' },
  },
});

serializer.serialize({
  search: '  regula  ',
  createdAt: new Date('2026-04-04'),
});
// { search: 'regula', createdAt: '2026-04-04' }

License

MIT