var port = process.env.PORT || 3000app.listen portconsole.log "Express server listening on port %d in %s mode %s", app.address().port, app.settings.env, app.VERSION
require('pkginfo')(module, 'version');console.log "Express server listening on port %d in %s mode %s", app.address().port, app.settings.env, module.exports.version
// rollup.config.js
import pkg from './package.json';import { terser } from "rollup-plugin-terser";import resolve from 'rollup-plugin-node-resolve';import commonJS from 'rollup-plugin-commonjs'import replace from 'rollup-plugin-replace';
export default {plugins: [replace({exclude: 'node_modules/**','MY_PACKAGE_JSON_VERSION': pkg.version, // will replace 'MY_PACKAGE_JSON_VERSION' with package.json version throughout source code}),]};