@webstyle/expresshooks

1.0.1 • Public • Published

Express.js routing lifecycle hooks

Installation

npm i @webstyle/expresshooks --save

before

const { before } = require('expresshooks');

async function logger() {
    // your code here....
    return true;
}

// Add before hook as middleware 
app.get("/", before(logger), function(req, res) {
  return res.send("Hello world");
});

after

const { after } = require('expresshooks');

async function logger(response) {
    // your code here...
    return true;
}

// Add after hook as middleware 
app.get("/", before(logger), function(req, res) {
  return res.send("Hello world");
});

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.11latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.11
1.0.00

Package Sidebar

Install

npm i @webstyle/expresshooks

Weekly Downloads

1

Version

1.0.1

License

none

Unpacked Size

2.13 kB

Total Files

4

Last publish

Collaborators

  • webstyle