How to use the pug/package.json.version function in pug

To help you get started, we’ve selected a few pug examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pugjs / pug-cli / index.js View on Github external
var basename = path.basename;
var dirname = path.dirname;
var resolve = path.resolve;
var normalize = path.normalize;
var join = path.join;
var relative = path.relative;

// Pug options

var options = {};

// options

program
  .version(
    'pug version: '     + require('pug/package.json').version + '\n' +
    'pug-cli version: ' + require(  './package.json').version
  )
  .usage('[options] [dir|file ...]')
  .option('-O, --obj ', 'JSON/JavaScript options object or file')
  .option('-o, --out <dir>', 'output the rendered HTML or compiled JavaScript to <dir>')
  .option('-p, --path </dir></dir>
github pugjs / pug-cli / test / index.js View on Github external
run(['-V'], function (err, stdout) {
      if (err) done(err);
      assert.equal(stdout.trim(), 'pug version: ' + require('pug/package.json').version + '\npug-cli version: ' + require('../package.json').version);
      run(['--version'], function (err, stdout) {
        if (err) done(err);
        assert.equal(stdout.trim(), 'pug version: ' + require('pug/package.json').version + '\npug-cli version: ' + require('../package.json').version);
        done()
      });
    });
  });