1.6.22 • Published 3 years ago

remark-mdx-remove-exports v1.6.22

Weekly downloads
3,459
License
MIT
Repository
github
Last release
3 years ago

remark-mdx-remove-exports

Build Status lerna Chat

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

Installation

npm:

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

Usage

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')

remark()
  .use(mdx)
  .use(removeExports)
  .process(vfile.readSync('example.md'), function (err, file) {
    if (err) throw err
    console.log(String(file))
  })

Now, running node example yields:

import { Donut } from 'rebass'

import OtherThing from 'other-place'

# Hello, world!

This is a paragraph

Contribute

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.

License

MIT © John Otander

1.6.22

3 years ago

1.6.20

3 years ago

1.6.21

3 years ago

1.6.19

4 years ago

2.0.0-next.8

4 years ago

1.6.18

4 years ago

1.6.17

4 years ago

2.0.0-next.7

4 years ago

1.6.15

4 years ago

1.6.16

4 years ago

2.0.0-next.6

4 years ago

2.0.0-next.5

4 years ago

2.0.0-next.4

4 years ago

1.6.14

4 years ago

1.6.13

4 years ago

1.6.12

4 years ago

2.0.0-next.3

4 years ago

1.6.11

4 years ago

1.6.10

4 years ago

1.6.9

4 years ago

1.6.8

4 years ago

1.6.7

4 years ago

1.6.6

4 years ago

1.6.5

4 years ago

2.0.0-next.1

4 years ago

1.6.4

4 years ago

1.6.3

4 years ago

2.0.0-next.0

4 years ago

1.6.2

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.9-ci.5

4 years ago

1.5.9

4 years ago

1.5.8

4 years ago

1.5.7

4 years ago

1.5.8-alpha.0

4 years ago

1.5.7-alpha.0

4 years ago

1.5.6

4 years ago

1.5.6-alpha.0

4 years ago

1.5.6-ci.0

4 years ago

1.5.5

4 years ago

1.5.4

4 years ago

1.5.3

4 years ago

1.5.2

4 years ago

1.5.1

5 years ago

1.5.0

5 years ago

1.4.5

5 years ago

1.4.4

5 years ago

1.4.3

5 years ago

1.4.2

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.26

5 years ago

1.0.25

5 years ago

1.0.23

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.18

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.8

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0-rc.4

5 years ago

1.0.0-rc.3

5 years ago

1.0.0-rc.2

5 years ago

1.0.0-rc.0

5 years ago

1.0.0-alpha.14

5 years ago