Socket
Socket
Sign inDemoInstall

component-scan

Package Overview
Dependencies
228
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    component-scan

A simple react component scanner


Version published
Maintainers
1
Install size
16.6 MB
Created

Readme

Source

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.

FAQs

Last updated on 16 Oct 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc