1.0.5 • Published 6 years ago
index-wizard v1.0.5
Wizzy
Simply CLI tool that will recursively create index files in a directory for React
components.
Usage
wizzy --d=PATH__TO__YOUR__DIRECTORY
This will crawl your directory and create index.js
files with ES6
exports like:
export { default as CamelCaseDirectory } from './camel-case-directory';
Note
- This follows the convention of directories separated by
dashes (-)
will translate to aReact
component using camel casing.
Example
bla-bloo-blob-splat -> BlaBlooBlobSplat
Your current
index.js
files are safe.Wizzy
will skip over them if they are presentThis automatically ignores any directories named
__tests__
Example
Using wizzy --d=./startDir
the following folder structure
.
├── startDir
| ├── form
| | └── form.js
| | ├── button
| | | └── button.js
| ├── input
| | └── input.js
will be changed to
.
├── startDir
| ├── form
| | └── form.js
| | └── index.js (export { default as Form } from './form)
| | ├── button
| | | └── button.js
| | | └── index.js (export { default as Button } from './button)
| ├── input
| | └── input.js
| | └── index.js (export { default as Input } from './input)