UNPKG

swapnil-next-app

Version:

Custom npm package for next js installation

20 lines (13 loc) 787 B
#!/usr/bin/env node const { execSync } = require('child_process'); // Define the name of your custom package here const packageName = 'my-next-app'; // Define the command to create a Next.js project const createNextAppCommand = `npx create-next-app ${packageName}`; // Define the command to install the additional dependencies const installDependenciesCommand = `cd ${packageName} && npm install --save-dev eslint prettier eslint-plugin-react eslint-plugin-react-hooks`; console.log(`Creating a new Next.js project with the name ${packageName}...`); execSync(createNextAppCommand, { stdio: 'inherit' }); console.log(`Installing additional dependencies...`); execSync(installDependenciesCommand, { stdio: 'inherit' }); console.log(`Done! Your new Next.js project is ready to go.`);