Socket
Socket
Sign inDemoInstall

@mdx-js/mdxast

Package Overview
Dependencies
Maintainers
3
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


Version published
Weekly downloads
1.5K
decreased by-13.28%
Maintainers
3
Weekly downloads
 
Created
Source

[Deprecated] @mdx-js/mdxast

This library has been pulled into @mdx-js/mdx and is no longer maintained.


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 30 Oct 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