Registry / devops / ndx-rest

ndx-rest

JSON →
library0.7.1jsnpmunverified

ndx-rest (v0.7.1) automatically generates a REST API from your ndx-framework database, creating CRUD routes for each table. It integrates with ndx-permissions and ndx-user-roles for security. Low maintenance, but relies on the ndx-framework ecosystem and is not actively updated. Alternatives like JSON Server or PostgREST may offer broader compatibility.

npm install ndx-rest
INSTALL
IMPORT
SIG · NDX-REST
N
ndx-rest
devopsjavascriptv0.7.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.

ndx-rest
require('ndx-rest')
import ndxRest from 'ndx-rest'
CJS only, no default export
constructor
new (require('ndx-rest'))()
const NdRest = require('ndx-rest'); new NdRest()
Export is a class or factory function, use with new
init
const rest = require('ndx-rest'); rest.init(app).then(...)
require('ndx-rest').init(app)
init returns a Promise, must await

Shows basic setup integrating ndx-rest with Express and ndx-framework database, including optional permissions and user roles.

const ndxRest = require('ndx-rest'); const express = require('express'); const app = express(); const rest = new ndxRest({ db: require('./database'), // ndx-framework database instance permissions: require('ndx-permissions'), // optional userRoles: require('ndx-user-roles') // optional }); async function start() { await rest.init(app); app.listen(3000, () => console.log('API running on port 3000')); } start();
Debug
Known issues
breakingndx-rest v0.7.x drops support for Node < 10
fix
Update to Node 10+
affects: >=0.7.0
deprecatedThe init() method with callback (without Promise) is deprecated
fix
Use async/await or .then()
affects: <0.7.0
gotchaAll routes require authentication by default; must configure ndx-permissions or disable
fix
Set auth: false in options or install ndx-permissions
affects: *
Errors
Common errors & fixes
TypeError: ndx_rest is not a constructor
Using ES import syntax with CJS-only module
fix
Use require('ndx-rest') instead of import
Cannot find module 'ndx-framework'
Missing peer dependency
fix
npm install ndx-framework
ndxRest.init is not a function
Forgetting to instantiate the class
fix
Use new ndxRest(options) before calling .init()
Upgrade
Version history
0.7.1latest on npm
Audit
Dependencies
ndx-frameworkrequiredcore framework required
ndx-permissionsoptionaloptional security integration
ndx-user-rolesoptionaloptional role-based access
Agent activity
9 hits · last 30 days
node
8
Amazon
1
Resources
ndx-rest — npm install ndx-rest · libregistry