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

express-hooked-native

v1.0.0

Published

Express-Hooked as a native N-API module with full feature parity

Maintainers

bdsyndicatebdsyndicate

Keywords

expresshooksmiddlewarenapinativefiltersactionswordpress-styleplugin-systemhook-systemexpress-middlewarenode-addonnode-nativev8javascript-hooksevent-drivenplugin-architectureextensiblemodularhook-frameworkexpress-pluginsnodejsserver-sideweb-frameworkapirestmiddleware-chainrequest-processingresponse-modificationdynamic-hookspriority-hooksnamespaced-hookshook-managementexpress-extensionsnode-extensionsperformancehigh-performancec++addon-apinode-gypserver-middlewarerequest-hooksresponse-hooksfilter-hooksaction-hookshook-prioritieshook-identifiersexpress-integrationweb-developmentbackendframeworkextension-systemmodular-architectureplugin-systemhook-patternevent-hooksrequest-response-cycleexpress-customizationnodejs-addonsnative-modulesserver-pluginsexpress-enhancementmiddleware-patternhook-engineplugin-engineexpress-utilitiesweb-serverhttp-middlewarerequest-handlingresponse-handlinghook-apiexpress-apinode-apiserver-extensionsdynamic-extensionsruntime-extensionsexpress-functionalityweb-applicationserver-side-hooksrequest-modificationresponse-modificationdata-transformationrequest-processingresponse-processinghook-executionfilter-executionaction-executionexpress-customizationexpress-enhancementsexpress-pluginsexpress-extensionsexpress-middlewareexpress-additionsexpress-toolsexpress-utilitiesexpress-featuresexpress-capabilitiesexpress-functionalityexpress-utilitiesexpress-componentsexpress-modulesexpress-librariesexpress-dependenciesexpress-addonsexpress-pluginsexpress-extensionsexpress-enhancementsexpress-improvementsexpress-featuresexpress-capabilitiesexpress-toolsexpress-utilitiesexpress-componentsexpress-modulesexpress-librariesexpress-dependenciesexpress-addonsexpress-pluginsexpress-extensionsexpress-enhancementsexpress-improvementsexpress-featuresexpress-capabilitiesexpress-toolsexpress-utilitiesexpress-componentsexpress-modulesexpress-librariesexpress-dependenciesexpress-addonsexpress-pluginsexpress-extensionsexpress-enhancementsexpress-improvementsexpress-featuresexpress-capabilitiesexpress-toolsexpress-utilitiesexpress-componentsexpress-modulesexpress-librariesexpress-dependenciesexpress-addonsexpress-pluginsexpress-extensionsexpress-enhancementsexpress-improvementsexpress-featuresexpress-capabilitiesexpress-toolsexpress-utilitiesexpress-componentsexpress-modulesexpress-librariesexpress-dependenciesexpress-addonsexpress-pluginsexpress-extensionsexpress-enhancementsexpress-improvementsexpress-featuresexpress-capabilitiesexpress-toolsexpress-utilitiesexpress-componentsexpress-modulesexpress-librariesexpress-dependenciesexpress-addonsexpress-pluginsexpress-extensionsexpress-enhancementsexpress-improvementsexpress-featuresexpress-capabilitiesexpress-toolsexpress-utilitiesexpress-componentsexpress-modulesexpress-librariesexpress-dependenciesexpress-addonsexpress-pluginsexpress-extensionsexpress-enhancementsexpress-improvementsexpress-featuresexpress-capabilitiesexpress-toolsexpress-utilitiesexpress-componentsexpress-modulesexpress-librariesexpress-dependenciesexpress

Readme

Express-Hooked-Native

Express-Hooked-Native is a native (N-API) version of the hooks system for Express.js. It provides a high-performance implementation of the WordPress-inspired hooks and filters system, completely written in C++ as a Node.js native extension.

Author

Benjamin Sanchez Cardenas

Features

  • High Performance: Native C++ implementation for fast operations
  • Full Compatibility: Same API as express-hooked
  • Complete Hook System: Actions and filters with namespace support
  • Priorities: Control execution order with priority levels
  • Identifiers: Hook management by unique identifier
  • Full Support: Complete Express.js integration

Installation

npm install express-hooked-native

Basic Usage

const ExpressHookedNative = require('express-hooked-native');

// Create hook system instance
const hookSystem = new ExpressHookedNative();

// Register an action
hookSystem.addAction('request_started', (req, res) => {
  console.log(`Request received: ${req.method} ${req.url}`);
});

// Register a filter
hookSystem.addFilter('modify_response_data', (data) => {
  return {
    ...data,
    processedBy: 'ExpressHookedNative',
    timestamp: new Date().toISOString()
  };
});

// Execute an action
hookSystem.doAction('request_started', req, res);

// Apply a filter
let responseData = { message: 'Hello World!' };
responseData = hookSystem.applyFilters('modify_response_data', responseData);

API

addAction(hookName, callback, priority, acceptedArgs, identifier)

Registers an action that executes at a specific point without modifying data.

addFilter(hookName, callback, priority, acceptedArgs, identifier)

Registers a filter that modifies data flowing through the application.

doAction(hookName, ...args)

Executes all registered actions for a specific hook.

applyFilters(hookName, value, ...additionalArgs)

Applies all registered filters for a specific hook to the provided value.

removeAction(hookName, identifier)

Removes a specific action by its identifier.

removeFilter(hookName, identifier)

Removes a specific filter by its identifier.

hasAction(hookName)

Checks if there are registered actions for a hook.

hasFilter(hookName)

Checks if there are registered filters for a hook.

actionsCount(hookName)

Gets the number of registered actions for a hook.

filtersCount(hookName)

Gets the number of registered filters for a hook.

Namespaces

You can organize your hooks using namespaces with the namespace::hookName format:

hookSystem.addAction('mymodule::before_request', (req, res) => {
  // Module-specific logic
});

hookSystem.doAction('mymodule::before_request', req, res);

Priorities

Control execution order with priority numbers (lower numbers execute first):

// Executes first (high priority)
hookSystem.addAction('request_started', callback, 5);

// Executes later (low priority)
hookSystem.addAction('request_started', callback, 15);

Express Integration

To use with Express:

const express = require('express');
const ExpressHookedNative = require('express-hooked-native');

const app = express();
const hookSystem = new ExpressHookedNative();

// Middleware to trigger hooks
app.use((req, res, next) => {
  hookSystem.doAction('request_started', req, res);
  next();
});

// Example route
app.get('/', (req, res) => {
  let data = { message: 'Hello World!' };
  data = hookSystem.applyFilters('modify_response', data);
  res.json(data);
});

app.listen(3000);

License

GPL 3.0