0.1.0 • Published 6 years ago

quintessence-compiler v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

quintessence-compiler

This compiles card definitions written in Quintessence Card Definition Language to JSON.

Use

npm install --save quintessence-compiler
import { compileMultiDefToJSON } from 'quintessence-compiler'

Example

import { compileMultiDefToJSON } from 'quintessence-compiler'
import fs from 'fs'

fs.readFile('myCard.txt', 'utf8', (error, sourceCode) => {
  if (error) {
    throw error
  }

  const json = compileMultiDefToJSON(sourceCode)
  const jsonString = JSON.stringify(json)

  fs.writeFile('myCard.json', jsonString, 'utf8', (error) => {
    if (error) {
      throw error
    }
  })
})
0.1.0

6 years ago