0.0.11 • Published 9 years ago

component-scan v0.0.11

Weekly downloads
7
License
MIT
Repository
github
Last release
9 years ago

React Component Scanner

A very simple component scanner that uses the Babel AST to find all of the component references from a projects JSX files.

Installation

npm install component-scan

Usage

component-scan -s src -o components.json

Example usage

node index.js -s examples

Caveats

This assumes that the client of a component doesn't rename the component. For example, this would probably be good:

var Footer = require('my-footer');
...
  render() {
    return (
      <Footer />
    );
  }

But this:

var Footer = require('my-footer');
...
  render() {
    var A = Footer;
    return (
      <A />
    );
  }

Is going to say that you are referencing the A component. And this:

var MyNameForFooter = require('my-footer');
...
  render() {
    return (
      <MyNameForFooter />
    );
  }

Is going to say that you are referencing MyNameForFooter. So... don't do that.

License

Licensed under MIT.

0.0.11

9 years ago

0.0.10

9 years ago

0.0.9

9 years ago

0.0.8

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago