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());
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'
}
});
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'
}
});