This compiles card definitions written in Quintessence Card Definition Language to JSON.
npm install --save quintessence-compiler
import { compileMultiDefToJSON } from 'quintessence-compiler'
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
}
})
})