finden
`finden` helps you _find_ where you're using components from a given library.
Last updated 2 years ago by wongterrencew .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install finden 
SYNC missed versions from official npm registry.

Usage

finden helps you find where you're using components from a given library.

Here's an example:

cd my-project
cat app.js
import React from 'react'
import Container from 'ui-library/container'
import Input from 'ui-library/input'
import Button from 'ui-library/button'

export default App = () => (
  <Container>
    <Input type='text' placeholder='username' />
    <Input type='password' placeholder='password' />
    <Button>Login</Button>
  </Container>
)

and now run finden to find all the components that come from ui-library!

$ finden ui-library
{
  "Container": {
    "fixtures/app.js": [
      7
    ]
  },
  "Input": {
    "fixtures/app.js": [
      8,
      9
    ]
  },
  "Button": {
    "fixtures/app.js": [
      10
    ]
  }
}

The json that is returned is a map of all the components that were found. Each component has a map from file names to an array of line numbers.

More specifically the schema is:

type ComponentMap = {
  [componentName: string]: FileMap
}

type FileMap = {
  [fileName: string]: LineNumber[]
}

type LineNumber = number

CLI

finden <pattern> [glob]
  • pattern - The search term. A JSX tag will be a match if it comes from an import statement that contains pattern
  • glob - An optional glob pattern to specify which files should be searched. Default value is **/*.js

Example

finden ui-library "**/*.jsx"

Installation

npm install -g finden

Current Tags

  • 1.0.1                                ...           latest (2 years ago)

2 Versions

  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 6
Dependencies (5)
Dev Dependencies (11)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |