Registry / database / express-admin

express-admin

JSON →
library2.0.0jsnpmunverified

Express Admin is a tool for creating end user administrative interfaces for relational databases (MySQL, MariaDB, PostgreSQL, SQLite) in Node.js. Version 2.0.0, last released in 2023, with no set release cadence. It renders a fully responsive Bootstrap 3 UI with backend rendering via Hogan.js and uses jQuery for frontend plugins. Key differentiators: it is a single middleware that auto-generates admin UI from database schema, supports complex table relationships (one-to-many, many-to-many, etc.), and uses a settings.json file for configuration.

npm install express-admin
INSTALL
IMPORT
SIG · EXPRESS-ADMIN
E
express-admin
databasejavascriptv2.0.0
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
const admin = require('express-admin')
import admin from 'express-admin'
This package uses CommonJS; no default ES module import
admin
app.use(admin({config, settings, users, custom}))
new admin({...})
It is a middleware factory, not a constructor; call it with an options object
require
const path = require('path'); admin({ config: require(path.join(__dirname, 'config.json')) })
admin({ config: { /* inline config */ } })
Config files must be loaded from disk as JSON objects; inline objects may work but not recommended

Basic setup of Express Admin middleware with required configuration files (config, settings, users, custom).

const express = require('express'); const admin = require('express-admin'); const path = require('path'); const app = express(); app.use( admin({ config: require(path.join(__dirname, 'config.json')), settings: require(path.join(__dirname, 'settings.json')), users: require(path.join(__dirname, 'users.json')), custom: require(path.join(__dirname, 'custom.json')), }) ); app.listen(3000, () => console.log('Express Admin running on http://localhost:3000'));
Debug
Known issues
breakingBreaking change in v2.0.0: config files must be loaded from disk as JSON objects; inline objects may not work
fix
Use require() to load JSON files
affects: >=2.0.0
deprecatedThe 'express-admin' package is based on outdated dependencies (Bootstrap 3.3.1, jQuery 1.9.1, Hogan.js) and may have security vulnerabilities
fix
Consider migrating to modern alternatives like AdminBro or React Admin
affects: *
gotchaThe admin middleware must be placed before other route handlers to work correctly
fix
Ensure app.use(admin(...)) is called before other app.use() or app.get() calls
affects: *
gotchaDatabase drivers must be installed separately (mysql, pg, sqlite3) depending on the database used
fix
Install the appropriate driver package: npm install mysql or npm install pg or npm install sqlite3
affects: *
Errors
Common errors & fixes
Error: Cannot find module 'express-admin'
Package not installed
fix
Run npm install express-admin
Error: listen EADDRINUSE :::3000
Port 3000 already in use
fix
Change the port number or kill the process using port 3000
Error: Cannot find module 'mysql'
MySQL driver not installed
fix
Run npm install mysql
Upgrade
Version history
2.0.0latest on npm
Audit
Dependencies
expressrequiredRequired as a peer dependency; the admin is an Express middleware
mysqloptionalMySQL database driver (if using MySQL/MariaDB)
pgoptionalPostgreSQL database driver (if using PostgreSQL)
sqlite3optionalSQLite database driver (if using SQLite)
Agent activity
4 hits · last 30 days
node
4
Resources
express-admin — npm install express-admin · libregistry