Nerdiest Political Manifesto
Have ideas to improve npm?Join in the discussion! »

babel-plugin-extract-import-names

1.6.22 • Public • Published

babel-plugin-extract-import-names

Babel plugin that extracts all variable names from import statements. Used by the MDX pragma.

Installation

yarn add babel-plugin-extract-import-names

Usage

const babel = require('@babel/core')

const BabelPluginExtractImportNames = require('babel-plugin-extract-import-names')

const jsx = `
import Foo from 'bar'
import { Bar } from 'baz'
`

const plugin = new BabelPluginExtractImportNames()

const result = babel.transform(jsx, {
  configFile: false,
  plugins: [plugin.plugin]
})

console.log(plugin.state.names)

License

MIT

Install

npm i babel-plugin-extract-import-names

DownloadsWeekly Downloads

1,159,675

Version

1.6.22

License

MIT

Unpacked Size

3.06 kB

Total Files

4

Homepage

mdxjs.com

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar