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

@nitrogenbuilder/client-preact

v1.0.0

Published

Nitrogen Builder Preact Client

Readme

@nitrogenbuilder/client-preact

This package provides the core Nitrogen client-side functionality to be used in all preact projects.

Installation

npm install @nitrogenbuilder/client-preact

Dynamic Data Templates

Use {{ }} syntax in string props to render dynamic data.

Path Resolution

Access nested values with dot notation:

{{ post.title }}
{{ post.author.name }}
{{ post.meta.og_image }}

Fallbacks with ||

Chain multiple values — the first non-empty result is used:

{{ post.subtitle || post.title }}
{{ post.custom_excerpt || post.excerpt || 'No excerpt available' }}
{{ author.display_name || author.username || 'Anonymous' }}

String Literals

Wrap literal strings in single quotes:

{{ 'Hello World' }}
{{ post.title || 'Untitled' }}

Filters

Apply transformations with :filter after a path. Filters chain left to right.

| Filter | Args | Description | Example | |---|---|---|---| | uppercase | — | Converts to UPPERCASE | {{ post.title:uppercase }} | | lowercase | — | Converts to lowercase | {{ post.title:lowercase }} | | capitalize | — | Capitalizes first character | {{ post.status:capitalize }} | | trim | — | Removes leading/trailing whitespace | {{ post.title:trim }} | | substring | (start) or (start, end) | Extracts a portion of the string | {{ post.title:substring(0,17) }} | | truncate | (length) | Truncates and appends ... if over length | {{ post.excerpt:truncate(55) }} | | striphtml | — | Removes all HTML tags | {{ post.content:striphtml }} |

Chaining Filters

Apply multiple filters in sequence:

{{ post.content:striphtml:truncate(100) }}
{{ post.title:trim:uppercase }}
{{ post.body:striphtml:trim:truncate(50) }}

String Concatenation with +

Join values and literals together:

{{ post.title:substring(0,17)+'...' }}
{{ post.first_name+' '+post.last_name }}
{{ 'By '+post.author.name }}

Combining Everything

Filters, concatenation, and fallbacks work together:

{{ post.title:substring(0,17)+'...' || 'Untitled' }}
{{ post.content:striphtml:truncate(100) || post.excerpt:striphtml || 'No content' }}
{{ post.author.name:uppercase || 'ANONYMOUS' }}

Custom Filters

Register custom filters from your project:

import { registerFilter } from '@nitrogenbuilder/client-core';

registerFilter('blogdate', (value) => {
  return new Date(value).toLocaleDateString('en-US', {
    month: 'short', day: 'numeric', year: 'numeric',
  });
});

// Usage: {{ post.date:blogdate }}

Dynamic Value Props (___dynamic)

For structured dynamic bindings (set via the builder UI), props ending in ___dynamic resolve a DynamicValue object:

interface DynamicValue {
  key: string;       // dot-notation path into dynamic data
  before?: string;   // prepended to the resolved value
  fallback?: string | boolean; // used if key resolves to empty
  after?: string;    // appended to the resolved value
}

These are processed separately from {{ }} templates and do not support filters.