Giter VIP home page Giter VIP logo

list-react-files's Introduction

list-react-files

Generated with nod NPM version Build Status Coverage Status

List React component files inside a directory

Install

$ npm install --save list-react-files

Usage

Example with ARc codebase:

import listReactFiles from 'list-react-files'

listReactFiles(__dirname).then(files => console.log(files))
/* 
[ 
  'src-example/components/App.js',
  'src-example/components/atoms/Atom/index.js',
  'src-example/components/atoms/Badge/index.js',
  'src-example/components/atoms/Block/index.js',
  'src-example/components/atoms/Button/index.js',
  'src-example/components/atoms/Caption/index.js',
  'src-example/components/atoms/Heading/index.js',
  'src-example/components/atoms/HorizontalRule/index.js',
  'src-example/components/atoms/Icon/index.js',
  'src-example/components/atoms/Input/index.js',
  'src-example/components/atoms/Label/index.js',
  'src-example/components/atoms/Link/index.js',
  'src-example/components/atoms/List/index.js',
  'src-example/components/atoms/LogoImage/index.js',
  'src-example/components/atoms/Paragraph/index.js',
  'src-example/components/atoms/PreformattedText/index.js',
  'src-example/components/atoms/Spinner/index.js',
  'src-example/components/atoms/TableCell/index.js',
  'src-example/components/atoms/TableRow/index.js',
  'src-example/components/atoms/Tooltip/index.js',
  'src-example/components/molecules/Blockquote/index.js',
  'src-example/components/molecules/Feature/index.js',
  'src-example/components/molecules/Field/index.js',
  'src-example/components/molecules/IconButton/index.js',
  'src-example/components/molecules/IconLink/index.js',
  'src-example/components/molecules/Modal/index.js',
  'src-example/components/molecules/Molecule/index.js',
  'src-example/components/molecules/PrimaryNavigation/index.js',
  'src-example/components/molecules/Slider/index.js',
  'src-example/components/molecules/Table/index.js',
  'src-example/components/organisms/FeatureList/index.js',
  'src-example/components/organisms/Footer/index.js',
  'src-example/components/organisms/Header/index.js',
  'src-example/components/organisms/Hero/index.js',
  'src-example/components/organisms/Organism/index.js',
  'src-example/components/pages/GenericPage/index.js',
  'src-example/components/pages/HomePage/index.js',
  'src-example/components/pages/NotFoundPage/index.js',
  'src-example/components/pages/SamplePage/index.js',
  'src-example/components/templates/GenericTemplate/index.js',
  'src-example/components/templates/PageTemplate/index.js',
  'src/components/App.js',
  'src/components/pages/HomePage/index.js'
 ] 
 */

API

listReactFiles

List react component files inside a directory

Parameters

Returns Promise<Array<string>>

License

MIT © Diego Haz

list-react-files's People

Contributors

diegohaz avatar greenkeeper[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

list-react-files's Issues

Failed in Gatsby

How to reproduce:

gatsby new blog https://github.com/gatsbyjs/gatsby-starter-blog
then
npm install --save list-react-files
and add to any component
import listReactFiles from 'list-react-files'

After than I got this output:

ERROR  Failed to compile with 4 errors 
This dependency was not found:
* fs in ./~/glob/glob.js, ./~/fs.realpath/index.js and 2 others
To install it, you can run: npm install --save fs

Installing fs not helping. Probably this is Gatsby problem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.