Skip to content

Concrete implementation of js-items for express.

License

Notifications You must be signed in to change notification settings

js-items/express

Repository files navigation

express

CircleCI codecov GitHub tag (latest SemVer) jscpd Known Vulnerabilities

express.js implementation of js-items

There is a fantastic alternative to this project (and @js-items/express is based on it): js-entity-repos/express.

The main differences to the @js-entity-repos/express:

  • different naming convention: using item instead of entity
  • cursor based pagination operates using before and after instead of cursor and direction
  • additional totalCount property on pagination object
  • optional enveloping response (GET /endpoint?envelope=true) for clients not capable of working with headers and JSONP
  • granular transactions handlers for each request handler - this could be used for i.e. authentication or permissions checks
  • possibility to override each request handler
  • ability to disable json body parser middleware if already present in the stack (enableJsonBodyParser: false)
  • by default all responses are pretty which improves readability, you can disable that by query param (/endpoint?pretty=false)

Installation:

npm i @js-items/express --save

Credits: