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

v1.0.3

Published

Vue Composition API provider, leaf text component and composable for typography and soft hyphenation.

Readme

Typographist for Vue

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

Components use Vue SFCs with <script setup lang="ts"> and type-based props.

Use the nearest provider to share a prepared core formatter and its bounded word cache. Each provider owns its own instance, including nested providers and separate server requests. Nested configuration is complete; it does not merge with an outer provider.

<script setup lang="ts">
import { ref, shallowRef } from 'vue';
import type { TypographistConfig } from '@elmenov-softworks/typographist';
import { TypographistProvider, TypographistText } from '@elmenov-softworks/typographist-vue';

const config = shallowRef<TypographistConfig>({
  locale: 'en',
  categories: ['quotes', 'nonbreakingSpacing'],
  cacheSize: 64,
});
const source = ref('"Hello"');
</script>

<template>
  <TypographistProvider :config="config">
    <TypographistText :text="source" />
    <TypographistText :text="source" locale="ru" />
  </TypographistProvider>
</template>

TypographistProvider accepts optional config: TypographistConfig<string> and a default slot. The public core configuration accepts custom locale definitions and their locale names. Omitted configuration uses core defaults. TypographistText accepts required text: string and optional locale: string and disabled: boolean (default false). It renders text without a wrapper and never interprets HTML-like strings.

Inside a descendant's setup, the hook has this signature:

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

The returned computed ref is read-only. Pass a ref or getter for changing inputs; a plain string is a fixed input. Keep the original source text:

const formatted = useTypographist(
  () => props.text,
  () => props.locale,
);
// Read formatted.value in script, or formatted in a template.

A missing provider throws. Locale overrides apply only to that consumer. Unknown locales throw by default. Set provider configuration unsupportedLocale: 'preserve' to keep text unchanged for unregistered explicit or default locales. The core hasLocale(locale) method reports whether rules are registered. Invalid configuration and malformed locales retain core errors. Soft hyphens, Unicode, protected content and empty strings retain core behavior.

Replace configuration immutably. Use shallowRef for configuration to preserve plugin identity and class instances rather than deeply proxying them. Scalars, primitive array contents and primitive rule settings compare by value. New equivalent array containers do not require stable identity. Custom plugins, locale definitions and callbacks compare by identity; replace their identity to request an update. Mutating plugin internals is not tracked. Supported explicit defaults compare equally to omitted defaults.

A meaningful configuration change prepares a replacement instance before publishing it and resets that provider's word cache. Failed preparation does not replace the previous valid instance. Ordinary parent updates retain the instance and cache. Each consumer memoizes its current derivation synchronously; unchanged inputs do not repeat formatting. A text change does not invalidate other consumers. Vue can still execute application renders for unrelated reasons.

Native Vue server rendering and hydration need no browser globals during import or server rendering. Use equal source text and configuration on server and client for equal initial text. No mutable service is shared between roots.

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

Set disabled to render the current source unchanged and skip locale lookup. The provider is still required. Refs and getters support enable/disable transitions:

<TypographistText :text="source" :disabled="disabled" />
const disabled = ref(false);
const formatted = useTypographist(source, () => props.locale, disabled);
const config = shallowRef({ locale: 'ja', unsupportedLocale: 'preserve' as const });