Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mdx-js/mdxast

Package Overview
Dependencies
Maintainers
2
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mdx-js/mdxast

Transforms MDAST to MDXAST

  • 0.4.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
827
decreased by-71.21%
Maintainers
2
Weekly downloads
 
Created
Source

@mdx-js/mdxast

Transforms MDAST to MDXAST.

Installation

npm i -S @mdx-js/mdxast

Usage

const unified = require('unified')
const remark = require('remark-parse')
const inspect = require('unist-util-inspect')
const toMDXAST = require('@mdx-js/mdxast')

const MDX = `
import { Foo } from 'bar'

# Hello, world!

<Foo />
`

const tree = unified()
  .use(remark)
  .parse(MDX)

const mdxast = toMDXAST(options)(tree)

console.log(inspect(mdxast))
Output
root[3] (1:1-7:1, 0-53)
├─ import: "import { Foo } from 'bar'" (2:1-2:26, 1-26)
├─ heading[1] (4:1-4:16, 28-43) [depth=1]
│  └─ text: "Hello, world!" (4:3-4:16, 30-43)
└─ jsx: "<Foo />" (6:1-6:8, 45-52)

Keywords

FAQs

Package last updated on 23 Mar 2018

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