Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including remark-mdx-remove-exports with all npm packages installed. Try it out:

var remarkMdxRemoveExports = require("remark-mdx-remove-exports")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

remark-mdx-remove-exports v1.6.5

Remove exports from the MDX AST


Build Status lerna Join the community on Spectrum

Remove export nodes from the MDXAST. This is useful for scenarios where the exports aren’t needed like an MDX playground.



npm install --save remark-mdx-remove-exports


Say we have the following MDX file, example.mdx:

import { Donut } from 'rebass'

import OtherThing from 'other-place'

export default props => <div {...props} />

# Hello, world!

This is a paragraph

And our script, example.js, looks as follows:

const vfile = require('to-vfile')
const remark = require('remark')
const mdx = require('remark-mdx')
const removeExports = require('remark-mdx-remove-exports')

  .process(vfile.readSync(''), function (err, file) {
    if (err) throw err

Now, running node example yields:

import { Donut } from 'rebass'

import OtherThing from 'other-place'

# Hello, world!

This is a paragraph


See the Support and Contributing guidelines on the MDX website for ways to (get) help.

This project has a Code of Conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.


MIT © John Otander

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free