Gathering detailed insights and metrics for nextjs14-plop-templates
Gathering detailed insights and metrics for nextjs14-plop-templates
Gathering detailed insights and metrics for nextjs14-plop-templates
Gathering detailed insights and metrics for nextjs14-plop-templates
Plop templates for Next.js 14, supporting both TypeScript and JavaScript.
npm install nextjs14-plop-templates
Typescript
Module System
Node Version
NPM Version
70.2
Supply Chain
98.8
Quality
78.5
Maintenance
100
Vulnerability
100
License
JavaScript (78.74%)
Handlebars (21.26%)
Total Downloads
387
Last Day
4
Last Week
7
Last Month
11
Last Year
387
3 Stars
4 Commits
1 Watching
1 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
1.0.3
Package Id
nextjs14-plop-templates@1.0.3
Unpacked Size
11.89 kB
Size
3.20 kB
File Count
8
NPM Version
9.6.7
Node Version
18.17.1
Publised On
06 Jul 2024
Cumulative downloads
Total Downloads
Last day
0%
4
Compared to previous day
Last week
600%
7
Compared to previous week
Last month
-15.4%
11
Compared to previous month
Last year
0%
387
Compared to previous year
1
Plop templates for Next.js 14 , supporting both TypeScript and JavaScript.
First, ensure you have Plop installed:
1npm install --save-dev plop
Then, install this package in your project:
1npm install --save-dev nextjs14-plop-templates
Create a plopfile.js
in your project root if you don't already have one.
Add the following to your plopfile.js
:
1const nextjsGenerators = require("nextjs14-plop-templates"); 2 3module.exports = function (plop) { 4 nextjsGenerators(plop); 5};
1npm run plop
Choose the generator you want to use:
Follow the prompts to generate your files.
The templates and generators provided by this package are designed to work with Next.js 14 and 15. They should continue to function correctly unless there are significant structural changes in future Next.js releases.
Creates a new React component.
Options:
Example output:
1import { ReactElement } from "react"; 2 3type ButtonProps = {}; 4 5const Button = ({}: ButtonProps): ReactElement => { 6 return <div>Button</div>; 7}; 8 9export default Button;
Creates a new Next.js API route.
Options:
Example output (with dynamic route "id"):
1import { NextRequest, NextResponse } from "next/server"; 2 3export async function GET(request: NextRequest, { params }: { params: { id: string } }) { 4 const id = params.id; 5 // Your GET logic here 6 return NextResponse.json({ message: `GET request for id: ${id}` }); 7} 8 9export async function POST(request: NextRequest, { params }: { params: { id: string } }) { 10 const id = params.id; 11 // Your POST logic here 12 return NextResponse.json({ message: `POST request for id: ${id}` }); 13} 14 15// Add other methods (PUT, DELETE) as needed
Creates a new Next.js page.
Options:
Example output:
1import { ReactElement } from "react"; 2 3export default function Page(): ReactElement { 4 return ( 5 <div> 6 <h1>Hello World</h1> 7 </div> 8 ); 9}
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.
No vulnerabilities found.
No security vulnerabilities found.