0.0.2 • Published 5 years ago

express-package-json-headers v0.0.2

Weekly downloads
1
License
BSD-2-Clause
Repository
github
Last release
5 years ago

Fill version and name from package.json in headers for express applications

Setup

npm install --save express-package-json-headers

Usage

The package exports a middleware function called addPackageJsonHeaders. It parses the contents of package.json in current working directory and sets the X-Package-Version and X-Package-Name headers respectively.

A primitive example can be found in the example folder:

const {addPackageJsonHeaders} = require('../dist/index');
const express = require('express');
const app = express();

app.use(addPackageJsonHeaders);

app.get('/', (req, res) => res.send('Hi!'));
app.listen(3000);