index.js
function render(file, data, outputDir) {
  if (!argv.unsafe && path.extname(file) === '.html')
    return console.error(chalk.red(file + ': To use .html as source files, add --unsafe/-u flag'))

  env.render(file, data, function(err, res) {
    if (err) return console.error(chalk.red(err))
    var outputFile = file.replace(/\.\w+$/, '') + '.html'
    if (outputDir) {
      outputFile = path.resolve(outputDir, outputFile)
      mkdirp.sync(path.dirname(outputFile))
    }
    console.log(chalk.blue('Rendering: ' + file))
    fs.writeFileSync(outputFile, res)
  })

}
function render(file, data, outputDir) {
  if (!argv.unsafe && path.extname(file) === '.html')
    return console.error(chalk.red(file + ': To use .html as source files, add --unsafe/-u flag'))

  env.render(file, data, function(err, res) {
    if (err) return console.error(chalk.red(err))
    var outputFile = file.replace(/\.\w+$/, '') + '.html'
    if (outputDir) {
      outputFile = path.resolve(outputDir, outputFile)
      mkdirp.sync(path.dirname(outputFile))
    }
    console.log(chalk.blue('Rendering: ' + file))
    fs.writeFileSync(outputFile, res)
  })

}
function render ( file , data , outputDir ) { if ( ! argv . unsafe && path . extname ( file ) === '.html' ) return console . error ( chalk . red ( file + ': To use .html as source files, add --unsafe/-u flag' ) ) env . render ( file , data , function ( err , res ) { if ( err ) return console . error ( chalk . red ( err ) ) var outputFile = file . replace ( / \.\w+$ / , '' ) + '.html' if ( outputDir ) { outputFile = path . resolve ( outputDir , outputFile ) mkdirp . sync ( path . dirname ( outputFile ) ) } console . log ( chalk . blue ( 'Rendering: ' + file ) ) fs . writeFileSync ( outputFile , res ) } ) }
Render one file
Render one file