Registry / testing / express-easy-rest

express-easy-rest

JSON →
library1.1.1jsnpmunverified

A lightweight, TypeScript-powered REST API framework built on Express, providing decorator-based controllers, model validation, and a clean separation of concerns. Currently at version 1.1.1, it requires Express >=4 and body-parser 1.x as peer dependencies. Designed for developers who want a structured, scalable API with minimal boilerplate, it leverages TypeScript decorators for defining routes and middleware. Alternative to other decorator-based frameworks like NestJS or ts.express, but with a simpler setup and less opinionated architecture. The package ships TypeScript type definitions. Release cadence appears low, with no recent updates since initial release.

npm install express-easy-rest
INSTALL
IMPORT
SIG · EXPRESS-EASY-REST
E
express-easy-rest
testingjavascriptv1.1.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.

ApplicationInstance
import { ApplicationInstance } from 'express-easy-rest'
const ApplicationInstance = require('express-easy-rest').ApplicationInstance
ESM default is available; CommonJS require may need .default or destructuring
Controller
import { Controller } from 'express-easy-rest'
const { Controller } = require('express-easy-rest')
Both ESM and CJS work, but ensure TypeScript experimentalDecorators and emitDecoratorMetadata are enabled in tsconfig
ApiController
import { ApiController } from 'express-easy-rest'
import { ApiController } from 'express-easy-rest/api-controller'
ApiController is a named export from the main package; no subpath imports
Get
import { Get } from 'express-easy-rest'
import Get from 'express-easy-rest'
Get is a named export, not a default export

Creates a simple REST API with a BookController exposing a GET /api/book/list endpoint using decorators and an ApplicationInstance.

// app.ts import { ApplicationInstance, Controller, ApiController, Get } from 'express-easy-rest'; class App extends ApplicationInstance {} export = new App(); // book.controller.ts @Controller({ basePath: '/book' }) export class BookController extends ApiController { private books: Array<{ id: number; title: string }> = [ { id: 1, title: 'Book 1' }, { id: 2, title: 'Book 2' } ]; @Get('/list') getBooks(): Promise<Array<{ id: number; title: string }>> { return Promise.resolve(this.books); } } // server.js (or compiled server.js) const express = require('express'); const app = require('./app'); const server = express() .use('/api', app.middleware()) .listen(3000, () => console.log('Server running on port 3000'));
Debug
Known issues
deprecatedThe library may not be actively maintained; check for breaking changes in Express 5.
fix
Consider using modern alternatives like NestJS or ts.express for active support.
affects: >=1.0.0
gotchaTypeScript decorators require experimentalDecorators and emitDecoratorMetadata to be true in tsconfig.json.
fix
Add "experimentalDecorators": true and "emitDecoratorMetadata": true to compilerOptions.
affects: >=1.0.0
gotchaCommonJS require may not work directly if the package's module resolution is misconfigured; some users report needing to use .default.
fix
Use const app = require('./app').default; or set esModuleInterop: true in tsconfig.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'express-easy-rest'
Package not installed or peer dependencies missing.
fix
Run npm install express-easy-rest express body-parser.
Unexpected token @
TypeScript decorators not enabled in tsconfig.json.
fix
Add "experimentalDecorators": true and "emitDecoratorMetadata": true to tsconfig.json.
Property 'middleware' does not exist on type 'ApplicationInstance'
The app instance is not correctly exported or initialized.
fix
Ensure the App class extends ApplicationInstance and is exported as shown in the quickstart.
Upgrade
Version history
1.1.1latest on npm
Audit
Dependencies
expressrequiredPeer dependency: required as the core HTTP server framework
body-parserrequiredPeer dependency: needed for parsing request bodies
Agent activity
2 hits · last 30 days
node
2
Resources
express-easy-rest — npm install express-easy-rest · libregistry