Available File Templates in Fastree
Fastree provides several built-in file templates to streamline your project structure. You can reference these templates in your fastree.config.json file.
π List of Templates
| Template Name | Description |
|---|---|
| ReactComponent | Generates a React functional component. |
| ReactHook | Creates a custom React hook. |
| ReactContext | Sets up a React context provider. |
| Service | Generates a service file (e.g., API calls, business logic). |
| Config | Creates a configuration file. |
| ExpressRoute | Generates an Express.js route handler. |
| Constant | Defines a constants file. |
| Middleware | Creates an Express.js middleware function. |
| NextApiRoute | Sets up an API route for a Next.js project. |
| NextLayout | Generates a Next.js layout component. |
| NextPage | Creates a Next.js page component. |
π How to Use
To use a template, define it in fastree.config.json like this:
{
"name": "<feature-name>-component.tsx",
"template": "ReactComponent"
}
When you run:
npx fastree generate auth
It will create:
src/components/auth/
βββ auth-component.tsx
β¨ Customize your setup by mixing different templates as needed!
Now youβre ready to supercharge your project generation with Fastreeβs templates! π