Preparing for system design interviews?  Try bugzed.com →

Node.js Middleware Hooks

JSON →
library 1.0.1 ·javascript maintenance
verified Jun 17, 2026

`mhook` is a small Node.js library that provides middleware-like hook functionality, particularly useful for structuring relations within entities in applications like ODMs or ORMs. It allows developers to define a set of named "actions" and then bind multiple hook functions to these actions. When an action is "triggered," all associated hooks are executed sequentially. Hooks can be asynchronous, supporting both traditional Node.js error-first callbacks and Promises for indicating completion or failure. The current stable version is 1.0.1. Its key differentiators include a simple API for sequential hook execution and built-in support for both callback and promise-based asynchronous operations, making it flexible for various async patterns. It focuses purely on the hooking mechanism without dictating how the hooked objects should behave beyond providing `on` and `trigger` methods.

total hits 17
actors 5 distinct systems
last hit 16d ago AhrefsBot
GPTBot
4
ByteDance
3
Script
1
Humans
3

top countries 🇺🇸 United States · 🇸🇬 Singapore · 🇨🇦 Canada · 🇩🇪 Germany · 🇬🇧 United Kingdom