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

@sigiljs/sigil

v0.4.5

Published

TypeScript-first Node.js HTTP framework offering schema-driven routing, modifier-based middleware, plugin extensibility, and flexible response templating

Readme

Sigil

TypeScript-first Node.js HTTP framework offering schema-driven routing, modifier-based middleware, plugin extensibility, and flexible response templating for both server and serverless deployments.

The current documentation is mostly just a stub and does not provide even half of the necessary information. The README file will be rewritten soon, but in the meantime you can get the information you need from the in-code documentation

Table of Contents

Installation

Install via npm:

npm install @sigiljs/sigil

Or using yarn:

yarn add @sigiljs/sigil

Quick Start

import { Sigil, seal } from "@sigiljs/sigil"

const app = new Sigil()

// Define a route with body validation
const userSchema = Sigil.defineSchema({
  id: seal.string().uuid(),
  name: seal.string().min(1)
})

app.route("/users").body(...userSchema).post(async (req, res) => {
  const body = req.body.json()
  // handle user creation...
  return res.response({ userId: body.id }, 201)
})

// Start the server
app.listen(3000, "0.0.0.0")

Core Concepts

Routes & Handlers

  • Declarative routing using HTTP methods (get, post, put, etc.)
  • Handlers receive a typed ClientRequest and a SigilResponsesList helper

Modifiers & Middleware

  • Modifiers attach to routes to transform or enrich the request before handlers
  • Global middleware via addMiddleware intercepts requests framework-wide

Plugins

Plugin Development Guide

Sigil plugins allow you to extend framework behavior through lifecycle hooks and internal APIs. Follow these steps to create and use a plugin:

Define the plugin class

import { SigilPlugin } from "@sigiljs/sigil"

export class MyPlugin extends SigilPlugin<{ greeting: string }> {
  constructor(config: { greeting: string }) {
    super()
    // access config via this.$pluginConfig.greeting
  }

  // called once on initialization
  public onInitialize() {
    this.logger({ level: "info", message: `MyPlugin initialized with greeting: ${ this.$pluginConfig.greeting }` })
  }

  // called on each request in order
  public onRequestReceived(req) {
    this.logger({ level: "debug", message: `Incoming request: ${ req.method } ${ req.path }` })
  }

  // called before sending each response
  public onBeforeResponseSent(req, res) {
    this.logger({ level: "debug", message: `Sending ${ res.code } for ${ req.method } ${ req.url }` })
  }
}

Register the plugin

import Sigil from '@sigiljs/core';
import { MyPlugin } from './plugins/my-plugin';

const app = new Sigil({ serverless: false });
app.addPlugin(MyPlugin, { greeting: 'Hello, world!' });

Use internal APIs

Within your plugin methods, access routing or middleware APIs:

this.$routes.forEach(([path, route]) => {
  this.logger({ level: "info", message: `Route mounted: ${ path }` })
})

this.sigil.addMiddleware((req, res) => {
  // custom logic before handlers
})

This guide helps you scaffold a Sigil plugin, log internal events, and leverage built-in APIs for middleware and routing.

  • Extensible via addPlugin, with lifecycle hooks:

    • onInitialize, onRequestReceived, onBeforeResponseSent, etc.
  • Access framework internals through injected context

Schema Validation

  • First-class integration with @sigiljs/seal for request schemas
  • Automatic type derivation: path params, query, headers, body
  • Validation is performed before handler execution

Response Templating

  • Customizable response templates via responseTemplate option
  • Built-in response helpers: SigilResponse, RawResponse, FileResponse, and HTTP exceptions

API Overview

new Sigil(options)

Instantiate the framework. Key options:

  • serverless: boolean to skip internal HTTP server
  • server.https: HTTPS server options
  • responseTemplate: custom formatting function
  • debug: validation and logging settings

Routing

app.route('/path', { modifiers: [MyModifier] })
  .get((req, res) => res.response({ hello: 'world' }));

Schema Definition

const [schema, meta] = Sigil.defineSchema({ id: seal.string() }, { name: 'IDSchema' });
app.route('/items').query(schema).get(handler);

Plugins & Middleware

app.addPlugin(MyAuthPlugin, { secret: '...' });
app.addMiddleware((req, res) => { /* ... */ });

Configuration Options

See SigilOptions and DebugOptions for all available settings:

  • codeOnlyResponse: HTTP codes without body
  • serverless, server.https
  • debug.validation.skip
  • debug.fancyOutput, debug.logger, debug.moduleLogger

Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/YourFeature
  3. Commit your changes: `git commit -m 'Add YourFeature'
  4. Push to the branch: git push origin feature/YourFeature
  5. Open a Pull Request

Please follow the code style guidelines and add tests for new behavior.

License

MIT