Mongoskin is a thin layer above the official MongoDB Node.js driver (node-mongodb-native) that provides a more convenient API, including deferred collection binding, helper methods for common operations, and automatic handling of open/close connections. Version 2.1.0 is the latest stable release, but the project is no longer actively maintained and has been effectively superseded by the native driver's modern features (e.g., connect(), collection() without callbacks). It depends on mongodb ^2.0 and supports Node >= 0.4.0. Key differentiators: simplified db/collection creation (no callback required), db.bind() for easy collection access, and promise-like patterns for core operations.
npm install mongoskinNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Connect to a MongoDB instance, bind a collection, and fetch documents using the simplified mongoskin API.
Migrate to the mongodb package directly: const { MongoClient } = require('mongodb');Always provide a callback or use a promise wrapper for async operations.
Call db.close() in the callback or use a try/finally block.
Avoid binding collections with names that shadow built-in db methods (e.g., 'admin', 'grid').
Ensure you are using mongoskin's db object (created via mongo.db()) and not a native Db instance.
Move db.close() inside the callback of the last operation or use a promise chain.
Run: npm install mongoskin --save