@enkidevs/curriculum-parser-json

9.2.3 • Public • Published

JSON -> AST for Enki Curriculum

This parser processes an Enki JSON and produces the Enki Curriculum AST.

const {
  contentTypes: { INSIGHT }
} = require("@enkidevs/curriculum-helpers");
const {
  getParser: getMarkdownParser
} = require("@enkidevs/curriculum-parser-markdown");
const {
  getCompiler: getJSONCompiler
} = require("@enkidevs/curriculum-compiler-json");
const {
  getParser: getJSONParser
} = require("@enkidevs/curriculum-parser-json");

const jsonCompiler = getJSONCompiler(INSIGHT);
const mdParser = getMarkdownParser(INSIGHT);
const jsonParser = getJSONParser(INSIGHT);

// get ast from a string
const ast = mdParser.parseSync(sampleInsight)

// get json from ast
const json = jsonCompiler.compileSync(ast)

// get ast back from json (using this package)
const ast2 = jsonParser.parseSync(json)

/@enkidevs/curriculum-parser-json/

    Package Sidebar

    Install

    npm i @enkidevs/curriculum-parser-json

    Weekly Downloads

    1

    Version

    9.2.3

    License

    MIT

    Unpacked Size

    9.49 kB

    Total Files

    11

    Last publish

    Collaborators

    • kapnobatai137
    • spypsy
    • mathieudutour
    • lukem512
    • stefanoeb
    • loopiezlol
    • nem035
    • oliviaoddo
    • pedromdrp
    • lizthedeveloper
    • sourabhv
    • milesflo
    • mihaiberq
    • enkici