Registry / database / monk-middleware-handle-callback

monk-middleware-handle-callback

JSON →
library0.2.2jsnpmunverified

This package provides a middleware for monk (a MongoDB driver for Node.js) that automatically handles callbacks in query pipelines. Version 0.2.2 is a very old, unmaintained package specifically designed for older versions of monk (pre-v5). It is not compatible with modern monk versions (v5+). The release cadence is unknown and likely abandoned. Key differentiator: it simplifies callback handling in monk middleware chains, but is superseded by monk's native Promise support.

npm install monk-middleware-handle-callback
INSTALL
IMPORT
SIG · MONK-MIDDLEWARE-HA
M
monk-middleware-handle-callback
databasejavascriptv0.2.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

handleCallback
const handleCallback = require('monk-middleware-handle-callback')
import handleCallback from 'monk-middleware-handle-callback'
This package uses CommonJS and does not support ESM imports.

Shows how to use the handle callback middleware with monk to simplify callback-based queries.

const monk = require('monk'); const db = monk('localhost/mydb'); db.addMiddleware(require('monk-middleware-handle-callback')); const collection = db.get('users'); collection.insert({ name: 'John' }, function(err, doc) { if (err) console.error(err); else console.log('Inserted:', doc); });
Debug
Known issues
deprecatedPackage is deprecated and unmaintained since 2016. Consider using monk's native Promise support or async/await instead.
fix
Remove middleware and use monk's built-in Promise API: await collection.insert(doc)
affects: all
breakingIncompatible with monk v5+ because monk changed its middleware API and now uses Promises natively.
fix
Upgrade to monk v5+ and remove this middleware dependency.
affects: >=5.0.0
gotchaThe middleware only works with callback-style monk methods (pre-v5). If you use Promises, the middleware will not be invoked.
fix
Ensure you are using callback syntax when this middleware is registered.
affects: all
Errors
Common errors & fixes
TypeError: db.addMiddleware is not a function
monk v5+ removed the addMiddleware method.
fix
Remove the middleware usage; monk v5+ does not support custom middleware.
Error: Middleware must accept three arguments
The middleware expects a specific signature that is not provided by monk v5+.
fix
Use monk v4 or lower, or remove this middleware entirely.
Upgrade
Version history
0.2.2latest on npm
Audit
Dependencies
monkrequiredPeer dependency: this middleware is designed to work with the monk package.
Agent activity
4 hits · last 30 days
node
4
Resources
monk-middleware-handle-callback — npm install monk-middleware-handle-callback · libregistry