How to use the consolidate.handlebars.render function in consolidate

To help you get started, we’ve selected a few consolidate 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 ant-ife / apfe-cli / src / lib / generate.js View on Github external
import chalk from 'chalk'
import Metalsmith from 'metalsmith'
import Handlebars from 'handlebars'
import async from 'async'
import { handlebars } from 'consolidate'
import path from 'path'
import multimatch from 'multimatch'
import getOptions, { getMetadata } from './options'
import logger from './logger'
import ask from './ask'
import filter from './filter'
import uuid from 'uuid/v4'
import { readJsonSync } from 'fs-extra'
import { existsFile } from './exists'

const render = handlebars.render
const defaultMeta = (modules = [], dest) => {
  const result = {}
  modules.forEach(module => {
    // if (module === 'offline-package') {
    //   result['offline'] = true
    // } else {
    //   result[module] = true
    // }
    result[module] = true
  })
  return Object.assign(result, {
    destDirName: modules.join('-'),
    inPlace: dest === process.cwd(),
    noEscape: true,
  })
}

consolidate

Modern and maintained fork of the template engine consolidation library. Maintained and supported by Forward Email <https://forwardemail.net>, the 100% open-source and privacy-focused email service.

MIT
Latest version published 5 months ago

Package Health Score

81 / 100
Full package analysis