Registry / web-framework / dolphin-server-modules

dolphin-server-modules

JSON →
library2.2.4jsnpmunverified

Dolphin Server Modules is the core utility package for the Dolphin Framework, an ultra-lightweight and modular backend ecosystem built on native Node.js. It provides fundamental functionalities for building Web, Microservices, and Industrial IoT applications, focusing on Auth, CRUD, Models, and Controllers. The current stable version is 2.2.4, with a recent feature release cadence indicated by updates like v2.2.1 and v2.2 bringing CLI usage and dynamic API proxies. Key differentiators include its zero-dependency core built on native `http` and `events`, universal compatibility with tools like Mongoose and Zod, support for Express-compatible multi-handler middleware, and native IIoT support via binary plugins for protocols like HL7 and Modbus. It also offers a unique server-served client library, eliminating the need for client-side NPM installations.

web-frameworkauth-securitydatabaseserializationhttp-networking
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.

The primary entry point for creating a Dolphin HTTP server. Dolphin is ESM-first.

import { createDolphinServer } from 'dolphin-server-modules/server';

Named export for the authentication utilities. Avoid default imports.

import { DolphinAuth } from 'dolphin-server-modules/auth';

Named export for CRUD operations, often used with ORMs like Mongoose. Ensure you're importing from the correct subpath.

import { DolphinCRUD } from 'dolphin-server-modules/crud';

Dolphin uses a unified `ctx` (context) object for handlers, similar to Koa. While it supports Express-style middleware, direct route handlers primarily use `ctx`.

(ctx) => { /* ... */ }

This quickstart demonstrates setting up a basic Dolphin web server with GET and POST routes, showcasing JSON serialization and context object usage.

import { createDolphinServer } from 'dolphin-server-modules/server'; const app = createDolphinServer(); app.get('/ping', (ctx) => { return { message: 'pong', version: '1.5.6' }; }); app.get('/hello/:name', (ctx) => { const name = ctx.params.name; return { greeting: `Hello, ${name}!` }; }); app.post('/data', async (ctx) => { const body = await ctx.req.json(); // Access raw request body console.log('Received data:', body); return { status: 'received', data: body }; }); app.listen(3000, () => console.log('🐬 Dolphin swimming on port 3000'));
dolphin --version
Debug
Known footguns
breakingDolphin Framework is ESM-first since early v2.x versions. Using CommonJS `require()` statements for module imports will likely fail or lead to unexpected behavior.
gotchaThe Dolphin client-side library (`dolphin-client.js`) is served directly by the Dolphin server. Do not attempt to install it via npm or other package managers, as it is not distributed that way.
gotchaThe framework primarily uses a unified `ctx` (context) object in route handlers for consistency. While it supports Express-compatible middleware, custom middleware or legacy Express middleware might require adaptation to the `(ctx, next)` signature.
gotchaThe `npx dolphin-server` CLI tool for instantly running a Dolphin server was introduced in v2.2.1. Older versions will not have this command available.
gotchaThe primary official master guide for Dolphin Framework is currently available in Nepali. While code examples are universal, detailed textual explanations are in Nepali, which might be a barrier for non-Nepali speaking developers.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
22 hits · last 30 days
gptbot
4
ahrefsbot
4
amazonbot
4
bytedance
4
script
1
Resources