How to use the mjml-core function in mjml-core

To help you get started, we’ve selected a few mjml-core 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 mjmlio / mjml / packages / mjml-cli / src / client.js View on Github external
inputs.forEach(i => {
    try {
      let compiled
      switch (inputOpt) {
        case 'm': // eslint-disable-line no-case-declarations
          compiled = { html: migrate(i.mjml, { beautify: true }) }
          break
        case 'v': // eslint-disable-line no-case-declarations
          const mjmlJson = MJMLParser(i.mjml, { components })
          compiled = {
            errors: validate(mjmlJson, { components, initializeType }),
          }
          break
        default:
          compiled = mjml2html(i.mjml, { ...config, filePath: filePath || i.file })
      }

      convertedStream.push({ ...i, compiled })
    } catch (e) {
      EXIT_CODE = 2
      failedStream.push({ file: i.file, error: e })
    }
  })
github mjmlio / mjml / packages / mjml-cli / src / commands / watchFiles.js View on Github external
args => ({
      ...args,
      compiled: mjml2html(args.content, {
        filePath: args.file,
        ...options.config,
      }),
    }),
    args => {