@enkidevs/curriculum-helpers

Helpers for parsing/transforming/compiling Enki Curriculum from and to different formats

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
537Jun 14, 2021Mar 14, 2018Minified + gzip package size for @enkidevs/curriculum-helpers in KB

Readme

Enki Curriculum Helpers

Helpers for parsing/transforming/compiling Enki Curriculum from and to different formats.

See Enki curriculum processors for more details.

const { contentTypes, compactAst } = require("@enkidevs/curriculum-helpers")
const { getParser } = require("@enkidevs/curriculum-parser")
console.log(
  JSON.stringify(
    compactAst(
      getParser(contentTypes.INSIGHT).parseSync(`---
author: enki
---

# This is an \`example\`
`)
    ),
    null,
    2
  )
)

Logs

{
  "type": "root",
  "children": [
    {
      "type": "yaml",
      "value": "author: enki",
      "data": {
        "parsedValue": {
          "author": "enki"
        }
      }
    },
    {
      "type": "headline",
      "children": [
        {
          "type": "text",
          "value": "This is an "
        },
        {
          "type": "inlineCode",
          "value": "example"
        }
      ]
    }
  ]
}

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.