Registry / web-framework / ndx-server

ndx-server

JSON →
library0.18.1jsnpmunverified

A lightweight, modular server framework built on Express and Alasql, providing a schemaless SQL database that treats JavaScript objects as first-class citizens. Version 0.18.1 is the latest stable release, with no regular update cadence. It eliminates the need for a dedicated database server, persists to S3 with minimal reads/writes, and uses sessionless tokens that survive server restarts. Key differentiators include auto-loading of modules from startup, services, and controllers folders, built-in authentication and token generation, and a plugin ecosystem for auth, sockets, and database backups. Designed for rapid prototyping and small-to-medium scale applications, it also supports scaling via ndx-sync.

npm install ndx-server
INSTALL
IMPORT
SIG · NDX-SERVER
N
ndx-server
web-frameworkjavascriptv0.18.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

default (ndx)
import ndx from 'ndx-server';
const { ndx } = require('ndx-server');
CommonJS default export via require('ndx-server') works, but named destructure fails.
default (ndx)
const ndx = require('ndx-server');
const NdxServer = require('ndx-server').default;
No ES module named export; use default import.

Creates a minimal ndx-server instance with one route, using in-memory database with two tables.

const ndx = require('ndx-server') .config({ database: 'myapp', tables: ['users', 'tasks'], port: 3000 }) .controller(function(ndx) { ndx.app.get('/api/hello', function(req, res) { res.json({ message: 'Hello from ndx-server!' }); }); }) .start(); console.log('Server running on port 3000');
Debug
Known issues
breakingAuto-loading of modules from /startup, /services, and /controllers folders may cause unexpected behavior if those directories exist with unintended files.
fix
Ensure no stray files are placed in these directories, or disable auto-loading via config.
affects: >=0.15.0
gotchandx-server uses Alasql which is not suitable for concurrent write-heavy production workloads.
fix
Consider using a proper database server or use ndx-sync for scaling but be aware of limitations.
affects: *
Errors
Common errors & fixes
Error: Cannot find module 'alasql'
Alasql is a peer dependency not installed automatically.
fix
Run `npm install alasql` alongside ndx-server.
TypeError: ndx.config is not a function
Using the module incorrectly, e.g., importing as a named export.
fix
Use `const ndx = require('ndx-server');` and chain methods on the returned object.
Upgrade
Version history
0.18.1latest on npm
Audit
Dependencies
expressrequiredFoundation HTTP server and routing
alasqlrequiredProvides the in-memory SQL database with persistence
Agent activity
14 hits · last 30 days
node
12
Amazon
1
OpenAI (training)
1
Resources
ndx-server — npm install ndx-server · libregistry