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.
npm install dolphin-server-modulesVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates setting up a basic Dolphin web server with GET and POST routes, showcasing JSON serialization and context object usage.
Ensure your project is configured for ESM (e.g., `"type": "module"` in `package.json`) and use `import` statements for all Dolphin modules.
Include `<script src="/dolphin-client.js"></script>` in your HTML file to load the client library. It's automatically exposed by the Dolphin server.
When writing middleware or handlers, use the `(ctx, next)` function signature. Access request details (like body or query params) via the `ctx` object properties (e.g., `ctx.query`, `ctx.params`, `ctx.req.json()`).
Upgrade `dolphin-server-modules` to v2.2.1 or newer to use the CLI. For older versions, you must create a dedicated server file and run it with `node`.
Consult community resources or translate the guide as needed. The code examples within the guide are self-explanatory for most developers.
Ensure your `package.json` contains `"type": "module"` and all imports use `import ... from '...'`. If using TypeScript, check `tsconfig.json` for `"module": "NodeNext"` or `"ESNext"` and `"moduleResolution": "NodeNext"`.
Verify that `import { createDolphinServer } from 'dolphin-server-modules/server';` is used, and that the `app` variable is correctly assigned the result of `createDolphinServer()`.Refactor your middleware to accept `ctx` as the first argument and `next` as the second. Use `await next()` to pass control to the next middleware or handler in the chain.
Ensure your HTML includes `<script src="/dolphin-client.js"></script>` before any script that attempts to use the `dolphin` global object. The Dolphin server must also be running to serve this file.
No dependency data recorded yet.