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

@elmenov-softworks/typographist-solid

v1.0.3

Published

Solid provider, leaf text component and reactive hook for locale-aware typography and soft hyphenation.

Readme

Typographist for Solid

For package selection and display-text integration, see the agent guide.

Each provider shares one prepared core formatter and its bounded word cache among its consumers. Nested providers and separate application roots own isolated instances. Nested configuration is complete and does not merge with an outer provider.

import { createSignal } from 'solid-js';
import type { TypographistConfig } from '@elmenov-softworks/typographist';
import { TypographistProvider, TypographistText, useTypographist } from '@elmenov-softworks/typographist-solid';

const Text = () => {
  const [source, setSource] = createSignal('"Hello"');
  const formatted = useTypographist(source);
  return <span>{formatted()}</span>;
};

const App = () => {
  const [config, setConfig] = createSignal<TypographistConfig>({
    locale: 'en',
    categories: ['quotes', 'nonbreakingSpacing'],
    cacheSize: 64,
  });

  return (
    <TypographistProvider config={config()}>
      <Text />
      <TypographistText text='"Hello"' locale="ru" />
    </TypographistProvider>
  );
};

The provider accepts optional config: TypographistConfig<string> and Solid children. The core configuration preserves custom locale definitions and names. Omitted fields use core defaults. The component accepts required text: string and optional locale: string, rendering a text node without a wrapper. HTML-like strings remain literal text.

Call the hook inside a descendant component or its reactive owner:

useTypographist(
  text: Accessor<string>,
  locale?: Accessor<string | undefined>,
  disabled?: Accessor<boolean>,
): Accessor<string>

The result is a read-only accessor. Pass signals or getters, including () => props.text and () => props.locale, to preserve reactivity. Use () => 'fixed source' for a constant. Keep the original source string for recomputation. Locale overrides affect only that consumer. A missing provider, unsupported locale under the default policy or invalid configuration throws. Empty strings, Unicode, soft hyphens and protected content retain core behavior.

Replace configuration immutably. Scalars, primitive array contents and declared primitive rule settings compare by value. Fresh equivalent configuration and array containers preserve the formatter. Custom plugins, locale definitions and callbacks compare by identity; replace their identity to request an update. Changes inside mutable plugin objects are not tracked. Supported explicit defaults compare equally to omitted defaults.

A meaningful configuration change prepares a replacement before publishing it and resets that provider's cache. Failed preparation leaves the previous valid service available if Solid retains or restores the consumer tree. Ordinary parent updates preserve prepared state and cache. Each consumer memoizes its current derivation synchronously. Unchanged inputs do not repeat formatting or schedule extra library updates; changing one consumer's text does not invalidate another.

Use native Solid server rendering and hydration, compiling server JSX with Solid's SSR transform. Imports and server rendering need no browser globals. Equal source and configuration produce equal initial text. No formatter is shared globally across roots or server requests.

See the core documentation for formatting categories, configuration defaults and text-processing limits.

Set disabled on a leaf component or pass a boolean accessor as the hook's third argument to return the current source and skip formatting and locale lookup. It defaults to false and still requires a provider.

const [disabled, setDisabled] = createSignal(false);
const formatted = useTypographist(source, () => 'en', disabled);
<TypographistText text={source()} locale="unknown" disabled={disabled()} />;

Use config={{ locale: 'unknown', unsupportedLocale: 'preserve' }} when the site's active language has no registered rules. Unsupported languages retain their source text; registered languages still format normally. The default policy is 'throw'. Core hasLocale(locale) reports registered rules without a regional fallback; see the core API.