Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ekliptor/expressutils
Helper functions for the Express framework (expressjs.com) to render templates, write meta tags, perform localization, implement REST APIs and more.
https://github.com/ekliptor/expressutils
express express-middleware expressjs mongodb nodejs webapp
Last synced: about 1 month ago
JSON representation
Helper functions for the Express framework (expressjs.com) to render templates, write meta tags, perform localization, implement REST APIs and more.
- Host: GitHub
- URL: https://github.com/ekliptor/expressutils
- Owner: Ekliptor
- License: gpl-3.0
- Created: 2018-05-28T06:29:30.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-05-28T06:30:43.000Z (over 6 years ago)
- Last Synced: 2024-11-09T04:34:01.648Z (3 months ago)
- Topics: express, express-middleware, expressjs, mongodb, nodejs, webapp
- Language: TypeScript
- Size: 28.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# expressutils
Helper functions for the Express framework (expressjs.com) to render templates, write meta tags, perform localization, implement REST APIs and more.
## Installation
```
npm install @ekliptor/expressutils
```## Usage
At the top of your source code file write:
with TypeScript:
```
import * as xutils from "@ekliptor/expressutils";
```with JavaScript:
```
const xutils = require("@ekliptor/expressutils");
```Now you can process requests with the Responder class of this module
```
router.get('/myRoute', (req, res, next) => {
let page = new MyPage(req, res, next);
page.sendMyResponse();
});class VpnPage extends xutils.Responder {
constructor(req, res, next) {
super(req, res, next)
}public sendMyResponse() {
// do something....
// this.req, this.res, this.next is available
// plus lot's of helper functions
}
}
```