express-version
v0.2.0
Published
Middleware for package.json and git metadata.
Downloads
262
Maintainers
Readme
express-version
Automatically publish package.json and git information out over your app.
var express = require('express'),
version = require('express-version');
var app = express();
app.use(version.pkg());
app.use(version.git());
Usage
.git
You can export branch
, commit
or tags
as a header. The defaults are shown below:
version.git({
path: process.cwd(),
headers: {
'X-Branch': 'branch',
'X-Commit': 'commit',
'X-Tags': 'tags'
}
});
.pkg
You can export any field in the package.json
file as a header. The defaults are shown below:
version.pkg({
path: process.cwd(),
headers: {
'X-Name': 'name',
'X-Version': 'version'
}
});