json2mjml

1.0.3 • Public • Published

json2mjml

Purpose

Converts a MJML template from JSON to XML.

Installation

yarn add json2mjml
 
# or 
 
npm i json2mjml

Usage

CLI

Input and output filenames must be set, both with their extensions.

json2mjml input.json output.mjml

Require hook

import json2mjml from 'json2mjml'
 
// or
 
const json2mjml = require('json2mjml')
 
const input = {
  tagName: 'mjml',
  children: [
    // ... your mjml
  ]
}
const output = json2mjml(input)
 
console.log(output)

mjml2json

If you need to convert a MJML template from a XML to JSON, check mjml2json.

Readme

Keywords

none

Package Sidebar

Install

npm i json2mjml

Weekly Downloads

724

Version

1.0.3

License

MIT

Unpacked Size

195 kB

Total Files

11

Last publish

Collaborators

  • kmcb
  • mjmlio
  • iryusa
  • loeck
  • ngarnier
  • meriadec