![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
express-package-json
Advanced tools
express middleware to expose the contents of package.json to the view engine via res.locals
Simple express function to expose the contents
of a package.json
file to the view engine. This is useful for displaying
the software version on a web page without having to update the page every
time the version changes in package.json
.
npm install --save express-package-json
Parameters:
pathToPackageJson
- path to the package.json
file. String. Defaults to ./package.json
.propertyName
- name of property to add to res.locals
. String. Defaults to pkg
.Returns:
(req, res, next)
.res.locals[variableName]
is set to a JavaScript object containing the parsed package.json
.next()
is called when complete.app.js
:
"use strict";
var express = require('express');
var expressPackageJson = require('express-package-json');
var app = express();
app.set('view engine', 'hbs');
app.use(expressPackageJson(path.join(__dirname, 'package.json')));
app.get('/', function (req, res) {
res.render('index');
});
views/index.hbs
:
{{pkg.name}} v{{pkg.version}}
npm test
See LICENSE.md
FAQs
express middleware to expose the contents of package.json to the view engine via res.locals
The npm package express-package-json receives a total of 12 weekly downloads. As such, express-package-json popularity was classified as not popular.
We found that express-package-json demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.