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

nulls

v2.12.2

Published

Simple HTML framework for express

Readme

Nulls

Simple HTML framework for express

Installation

npm install nulls

Structure

nulls drawio

The nulls framework is a wrapper around express.js and other useful modules with the goal of making the process of developing websites quicker and easier.

This framework offers a wide range of configuration options while making everything as secure as possible.

  • Highly configurable framework
  • Very adaptive server-side rendering engine
  • Simple dynamic HTML structure

HTML

Writing dynamic HTML was never as easy as with nulls!

The HTML files are being parsed on the server using cheerio, making DOM modifications simple and intuitive.

nulls adds a couple of custom HTML attributes, which are parsed on the server and removed completely on the client. Internal handlers receive the request object with parsed cookies, and additional arguments if provided.

Since internal handlers are executed directly in the framework, it is super easy to integrate modular logic, and you don't have to learn "yet another rendering language™" - use the all beloved JavaScript.

  • null-container - replace HTML in the element
    • null-list - iterate over something and make a total html out of it; all further handlers will be passed an additional argument: the current item of the iterable; arguments persist to next levels
  • null-adder - add HTML to the element (useful for SEO in e.g. <head>)
    • null-list - iterate and add
  • null-data - server-side data retrieval (useful for title and other placeholders)
  • null-api - form (or button) with the parameter
    • null-upload - additional parameter to parse files server-side
    • null-access - additional parameter to verify the API endpoint is called with correct permissions (or else Error 403)
    • null-ajax - additional parameter to add client-side processing of an API request
  • null-attr - handler returns name-value object; the attributes are set on element
  • null-if - conditional execution
  • null-arg - pass an additional argument to all handlers on the element

Example:

root.html

<ul null-list="() => [{ 'v': 46 }, { 'v': 69, }, { 'v': 83 }]" null-adder="#partials/list-item.html">
</ul>

partials/list-item.html

<li null-data>
 <script null-data>
  const calculate = require("./lib/math.js");
  return async (r, s, d) => {
    const value = d.v;
    return await calculate(value);
  };
 </script>
</li>

Result on the client:

<ul>
  <li>1081</li>
  <li>2415</li>
  <li>3486</li>
</ul>

Configuration

Here's a brief overview of all configs available at creation of a nulls instance.

  • uploads - false or a path to the uploads folder
  • uploadLimit - false or a total limit for one API request with files attached
  • forceHTTPS - whether to redirect the clients to HTTPS
  • init - a function which receives the express app
    • Executed before any logic is added to the app by the framework
    • Useful for custom rate-limiting, blacklisting logic etc.
  • hook - a function which is called on every request except the HEAD request
    • Useful for authentication (see the official auth plugin)
  • nulls - the folder where all HTML files are stored
  • root - the name of the "root HTML file" relative to nulls
  • static - false or a path to statically served files
  • port - the local port to host the website
    • Usually an automatically assigned port by the hosting software
  • ready - a callback for when the server is up and running
  • preprocessor - function to pre-process every single HTML chunk
  • postprocessor - function to post-process the result as HTML
  • textprocessor - function to post-process the result as raw text
  • srcProviders - lookup for custom source/script providers
    • Mainly used by plugins
  • plugins - an array of config modifying functions
  • domain - the host name ofnyour website
    • Used in security options such as CORS and HTTPS redirects
  • redirects - lookup for HTML redirects
    • Since the framework uses sameorigin policy, authentication may not work when landing on your website from an external provider
  • proxies - passed to app.set('trust proxy', proxies) in order to securely process IP adresses
    • Useful for reverse proxies such as cloudflared tunnel
  • publicUploads - serve user-generated content