Registry / database / warp-server

warp-server

JSON →
library0.3.3jsnpmunverified

Warp Server is an Object-Relational Mapper (ORM) designed for scalable web applications, currently at version 6.8.7. It provides a structured approach to defining database schemas, including tables, columns with validation, and triggers for pre- and post-operation hooks. Developers can build complex queries, implement server-side functions for custom business logic, and enforce access restrictions based on user roles. A key differentiator is its built-in support for implementing RESTful APIs via an Express middleware. As of now, it exclusively supports MySQL, with the roadmap indicating plans for additional database adapters in future releases. The project maintains a stable release cadence, with version 6.x being the current focus, explicitly differentiating its documentation and usage from older versions 5.x and legacy releases.

npm install warp-server
INSTALL
IMPORT
SIG · WARP-SERVER
W
warp-server
databasejavascriptv0.3.3
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.

Warp
import Warp from 'warp-server';
const Warp = require('warp-server');
Warp is primarily designed for ESM environments, especially with TypeScript. CommonJS require() may lead to undefined or incorrect module resolution if not configured properly with tools like Babel or TypeScript's `esModuleInterop`.
Class
import { Class, Key } from 'warp-server';
import { Class } from 'warp-server/decorators';
Decorators like `@Class` and `@Key` are used for defining schemas. While often placed in a 'decorators' subpath, the primary module export is indicated here. This import path is inferred based on common ORM patterns and requires review as not explicitly shown in the truncated README.
reflect-metadata
import 'reflect-metadata';
This is a side-effect import and should be done once, ideally at the entry point of your application, to enable decorator metadata emission.

Initializes a Warp service instance with a MySQL database connection, demonstrating the basic setup and asynchronous initialization.

import 'reflect-metadata'; import Warp from 'warp-server'; // Replace with your actual database connection string const databaseURI = 'mysql://youruser:password@yourserver.com:3306/yourdatabase?charset=utf8'; const service = new Warp({ databaseURI }); async function startService() { try { await service.initialize(); console.log('Warp service initialized successfully. You can now define and interact with your models.'); // Example: You would define your classes and start querying here. // @Class() // class User { // @Key({ primary: true, autoIncrement: true }) id: number; // @Key() name: string; // } // service.define(User); // const newUser = await service.create(User, { name: 'John Doe' }); // console.log('New user created:', newUser); } catch (error) { console.error('Failed to initialize Warp service:', error); } } startService();
warp-server --version
Debug
Known issues
breakingWarp Server versions 6.x introduce significant changes and are not backward compatible with versions 5.x or legacy versions. Consult the version-specific documentation to avoid issues.
fix
Refer to the `readme-v6.md` (or relevant version) documentation for migration guides and updated API usage. Do not mix dependencies from different major versions.
affects: >=6.0.0
gotchaTo utilize decorators (e.g., for class and key definitions), your `tsconfig.json` must have `"experimentalDecorators": true` and `"emitDecoratorMetadata": true` configured under `"compilerOptions"`.
fix
Add or ensure the presence of `"experimentalDecorators": true` and `"emitDecoratorMetadata": true` in your `tsconfig.json`'s `"compilerOptions"`.
affects: >=6.0.0
gotchaThe `reflect-metadata` library is a mandatory peer dependency for Warp Server when using TypeScript decorators. It must be installed and imported once at the application's entry point.
fix
Install `reflect-metadata` via `npm install --save reflect-metadata` and add `import 'reflect-metadata';` at the very top of your main application file (e.g., `index.ts`).
affects: >=6.0.0
gotchaCurrently, Warp Server officially supports only MySQL databases. While other adapters are planned, direct usage with other database systems is not supported and will result in errors.
fix
Ensure your `databaseURI` is configured for a MySQL connection. Check the documentation for updates on support for other database systems if needed.
affects: >=6.0.0
Errors
Common errors & fixes
ReferenceError: Reflect is not defined
`reflect-metadata` library was not imported or `emitDecoratorMetadata` is not enabled.
fix
Ensure `import 'reflect-metadata';` is at the top of your main application file and `"emitDecoratorMetadata": true` is in your `tsconfig.json`.
TypeError: Warp is not a constructor
Attempting to use CommonJS `require()` syntax or incorrect module resolution when `warp-server` is an ES Module.
fix
Use ES Module `import Warp from 'warp-server';` syntax. If using Node.js, ensure your package.json has `"type": "module"` or your file uses the `.mjs` extension, and/or your TypeScript compiler options (`moduleResolution`, `esModuleInterop`) are correctly set for ESM.
Upgrade
Version history
0.3.3latest on npm
Audit
Dependencies
reflect-metadatarequiredRequired for decorator-based class definition and metadata reflection in TypeScript.
expressoptionalCommonly used for building RESTful APIs with Warp's middleware functionality.
Agent activity
18 hits · last 30 days
node
14
Meta
1
OpenAI (training)
1
Resources
warp-server — npm install warp-server · libregistry