A minimal Express.js middleware that automatically exposes CRUD (Create, Read, Update, Delete) routes compatible with React Admin's Simple Rest Data Provider. Version 8.1.0 is current, with a stable release cadence (major updates every few months). ORM-agnostic: works with any data source via connectors (e.g., Sequelize, Mongoose, Knex). Key differentiators: one line per resource, automatic route generation, built-in pagination with X-Total-Count header, and custom filter support. Ships TypeScript types. Peer dependency on Express ^4.0.0.
npm install express-crud-routerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic CRUD route setup with in-memory data store, including get, create, update, and destroy handlers.
Upgrade to >=8.0.0 or ensure your connector returns total in X-Total-Count header.
Use X-Total-Count header; content-range is ignored unless Range request header is present.
Set destroy handler to null explicitly to disable; ensure other actions are not null inadvertently.
Avoid returning same key from multiple filter handlers; merge manually if needed.
Use import syntax or enable ESM in your project (type: module in package.json).
Run 'npm install express-crud-router' and ensure it's in dependencies.
Use 'import crud from "express-crud-router"' (default import) or 'const crud = require("express-crud-router").default' if in CJS environment.Ensure get handler returns an object with 'rows' (array) and 'total' (number).
Check that app.use(crud(...)) is called with correct path and that actions object includes 'create' handler.