Socket
Socket
Sign inDemoInstall

mkast

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mkast

Commonmark AST transformer


Version published
Weekly downloads
1.5K
increased by25.87%
Maintainers
1
Weekly downloads
 
Created
Source

Table of Contents

  • AST Transformer

AST Transformer

Build Status npm version Coverage Status.

Transforms commonmark AST documents to and from JSON for piping between processes.

Install

npm i mkast

Usage

Serialize commonmark AST to line-delimited JSON:

var cmark = require('commonmark')
  , parser = new cmark.Parser()
  , mkast = require('mkast')
  , ast = parser.parse('# Title\n<? @include file.md ?>');
mkast.serialize(ast).pipe(process.stdout);

For more information see the api docs.

API

deserialize

deserialize(stream[, cb])

Deserialize line-delimited JSON to commonmark AST.

When a callback function is given it is added as a listener for the error and eof events on the deserializer stream.

Returns the deserializer stream.

  • stream Object input stream.
  • cb Function callback function.

serialize

serialize(buffer[, cb])

Serialize a commonmark AST to line-delimited JSON.

When a callback function is given it is added as a listener for the error and finish events on the serializer stream.

Returns the serializer stream.

  • buffer Object input AST.
  • cb Function callback function.

License

MIT.

Generated by mdp(1).

Keywords

FAQs

Package last updated on 13 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc