title: Can my node.js program get the npm version number?
body: <p>I have a Node.js web application that uses the version number (when a request from a client asks for the version number). For now, when I change my version, I have to change it in three places:</p>
  
  <h1>In <code>server.js</code></h1>
  
  <pre><code>const version = 'v1.2.3'
  </code></pre>
  
  <h1>In <code>package.json</code></h1>
  
  <pre><code>"version": "1.2.3"
  </code></pre>
  
  <h1>In <code>doc.html</code></h1>
  
  <pre><code>&lt;h1&gt;version 1.2.3&lt;/h1&gt;
  </code></pre>
  
  <p>Is there a way to edit it in one place and use it in the others?</p>
  
  <p><em>Note</em>: <code>server.js</code> and <code>doc.html</code> are related like this:</p>
  
  <pre><code>// in server.js, using express
  app.get('/', function(req, res) {
    res.sendFile(__dirname + '/public/doc.html')
  })
  </code></pre>