babel-plugin-extract-import-names
Extract import names
Last updated 5 years ago by johno .
MIT · Repository · Bugs · Original npm
$ cnpm install babel-plugin-extract-import-names 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.6.8-ci.4                                ...           ci (5 years ago)
  • 1.6.22                                ...           latest (5 years ago)
  • 2.0.0-next.8                                ...           next (5 years ago)

10 Versions

  • 2.0.0-next.8                                ...           5 years ago
  • 1.6.22                                ...           5 years ago
  • 1.6.15                                ...           5 years ago
  • 2.0.0-next.7                                ...           5 years ago
  • 1.6.8-ci.4                                ...           5 years ago
  • 1.6.16                                ...           5 years ago
  • 2.0.0-next.1                                ...           5 years ago
  • 1.5.8-alpha.0                                ...           6 years ago
  • 1.6.5                                ...           5 years ago
  • 1.6.1                                ...           5 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org