Registry / devops / finale-rest

finale-rest

JSON →
library1.2.2jsnpmunverified

Create RESTful endpoints and controllers from Sequelize models using Express or Restify. Compatible with Sequelize 4.x and 5.x, this library is a fork of Epilogue that adds support for newer Sequelize versions. It provides automatic CRUD routes (create, read, update, list, delete) with hook-based customization (start, auth, fetch, data, write, send, complete). Includes built-in error types like ForbiddenError. Last release: v1.2.2, with a maintenance-driven release cadence. Differentiators: drop-in replacement for Epilogue, supports both Express and Restify, flexible hooks for custom behavior.

npm install finale-rest
INSTALL
IMPORT
SIG · FINALE-REST
F
finale-rest
devopsjavascriptv1.2.2
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.

finale
import finale from 'finale-rest'
const finale = require('finale-rest') // works for CJS; for ESM use default import
Default export in ESM; for CommonJS use require('finale-rest')
ForbiddenError
import { ForbiddenError } from 'finale-rest'
const { ForbiddenError } = require('finale-rest') // works; ensure destructuring
Named export for error types; available as both named and via Errors.ForbiddenError
Errors
import { Errors } from 'finale-rest'
Namespace containing all error classes (e.g., ForbiddenError, NotFoundError)
resource
const { resource } = finale;
import { resource } from 'finale-rest' // resource is not a top-level export; use via finale.resource()
resource() is a method on the default export; not a named export directly from the package

Shows basic setup: Sequelize model, Express app, initialize finale, create CRUD resource, sync database, and start server.

import Sequelize from 'sequelize'; import finale from 'finale-rest'; import http from 'http'; import express from 'express'; const database = new Sequelize('database', 'root', ''); const User = database.define('User', { username: Sequelize.STRING, birthday: Sequelize.DATE }); const app = express(); app.use(require('body-parser').json()); const server = http.createServer(app); finale.initialize({ app, sequelize: database }); const userResource = finale.resource({ model: User, endpoints: ['/users', '/users/:id'] }); database.sync({ force: true }).then(() => { server.listen(3000, () => console.log('listening on http://localhost:3000')); });
Debug
Known issues
deprecatedfinale-rest is not actively maintained; use at your own risk with newer Sequelize versions.
fix
Consider migrating to sequelize-auto-paginate or building your own REST endpoints with Sequelize directly.
affects: <1.3.0
gotchaSequelize 6.x is not supported; use Sequelize 4.x or 5.x.
fix
Downgrade Sequelize to 5.x or use a different library like featherjs-sequelize.
affects: >=1.0.0
gotchaBody-parser and query-parser middleware must be configured manually; finale does not set them.
fix
Ensure you add 'body-parser' for Express or 'restify.plugins.bodyParser()' for Restify before initializing finale.
affects: >=1.0.0
breakingIn v1.0.0, the 'resource' method no longer accepts 'sequelize' option; sequelize must be passed via initialize().
fix
Call finale.initialize({ sequelize: db }) before finale.resource().
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: finale.initialize is not a function
Missing or incorrect import of finale.
fix
Ensure you import finale correctly: const finale = require('finale-rest');
SequelizeError: database is not defined
finale.initialize called without sequelize instance.
fix
Add sequelize option: finale.initialize({ app, sequelize: database });
ResourceError: endpoints must be an array
endpoints provided as string instead of array.
fix
Use array: endpoints: ['/users', '/users/:id']
Error: No method found for GET /users/:id
Missing route definition or typo in endpoint.
fix
Check endpoints array includes '/users/:id' and that the model is synced.
Upgrade
Version history
1.2.2latest on npm
Audit
Dependencies
sequelizerequiredRequired for model definitions and database operations
expressoptionalRequired as the HTTP framework (or restify)
restifyoptionalAlternative HTTP framework to Express
Agent activity
2 hits · last 30 days
node
2
Resources
finale-rest — npm install finale-rest · libregistry