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

nicholas-wp

v1.0.7

Published

WordPress support for Nicholas nearly headless theme framework

Readme

Nicholas WordPress Implementation

Nicholas is a small, extend-able client-side caching, and routing layer for websites. It was originally built to make using the Nearly Headless approach easier to accomplish, but it is also most-likely compatible with fully headless sites.

This is the WordPress implementation of Nicholas, and it provides components to make building interfaces to customize compatibility mode URLs, as well as a few WordPress-specific middlewares for the Nicholas router.

Requirements

To use this implementation, you'll also need to set up the Nicholas Underpin Module, which creates the back-end support necessary to make the components and middleware provided in this package work.

Installation

npm install nicholas-wp

Compatibility Mode App

Nicholas comes with a React component that allows you to build a compatibility mode interface inside the WordPress editor. A basic setup to render this would look like this:

import { render } from '@wordpress/element'
import { Admin } from 'nicholas-wp/admin'
import fetch from 'nicholas-wp'

// Render the app
window.onload = () => render( <Admin/>, document.getElementById( 'app' ) )

// Export fetch, so we can add midleware via PHP
export { fetch }

However, you can pass children to Admin, as well, if you want to add more components within the app:

import { render } from '@wordpress/element'
import { Admin } from 'nicholas-wp/admin'
import fetch from 'nicholas-wp'

function CustomComponent( props ) {
	return <h1>This will get appended to the bottom of the app. The props contain items needed to update the app's
		state.</h1>
}

// Render the app
window.onload = () => render( <Admin>
	<CustomComponent/>
</Admin>, document.getElementById( 'app' ) )

// Export fetch, so we can add midleware via PHP
export { fetch }

Compatibility Mode Toggle for Posts

It's possible to add a compatibility mode toggle to your posts using the CompatibilityModeToggle component, like so:

import { registerPlugin } from '@wordpress/plugins';
import CompatibilityModeToggle from './nicholas-wp/editor/CompatibilityModeToggle'

registerPlugin( 'theme', { render: () => <CompatibilityModeToggle/> } );

WordPress-specific Nicholas Router Middlewares

Nicholas Router supports adding middleware to routes. This package includes a couple handy middlewares to help with routing in a WordPress environment, including:

  1. Middleware to update the "edit post" in the admin bar
  2. Middleware to validate that a clicked link is not an admin URL.

To use these, you just need to add them to your router, like so:

import {addRouteActions, validateMiddleware } from 'nicholas-router'
import {updateAdminBar, validateAdminPage, validateCompatibilityMode, primeCache} from 'nicholas-wp/middlewares'

	addRouteActions(
		// First, validate the URL
		validateMiddleware,
		// Validate this page is not an admin page
		validateAdminPage,
        // Validate compatibility mode.
        validateCompatibilityMode,
        // Prime the cache to be used afterward.
        primeCache,
		// Maybe update the admin bar
		updateAdminBar
	)