Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

create-next-pwa

msaaddev148MIT3.4.3

Set up Next.js Progressive Web App with npx create-next-pwa

nextjs, nextjs typescript, pwa, create-next-app, progressive web app, create-next-pwa, msaaddev, Saad Irfan, nextjs progressive web app, nextjs typescript progressive web app, nextjs pwa

readme

cover

⚡️ create-next-pwa

version downloads license nominate @msaaddev for GitHub Star

A cross-platform Node.js based CLI tool that creates Progressive Web App (PWA) with Next.js. You can also integrate tailwind with the Next.js PWA using this CLI with a single command.

separator

  • Simple: One command Next.js Progressive Web App setup
  • Cross-platform: Works on all available operating systems including Linux, macOS, and Windows
  • Support: Also supports TypeScript Next.js PWA with --typescript flag
  • Tailwind: Instantly integrate Tailwind using --tailwind flag in your Next.js PWA.
  • Prettier: Integrated Prettier to easily format the code with npm run format
  • MIT Licensed: Free to use for personal and commercial use.

Note: If you are on Windows, make sure to either use Command Prompt or Windows Powershell to run the CLI.

📦 Installation

# install the CLI globally
npm i -g create-next-pwa

# use it with npx (recommended)
npx create-next-pwa [app_name]

🚀 Usage

Navigate to the folder you want to have your Next.js PWA.

# using npx
npx create-next-pwa@latest [app_name]

# if you have installed globally
create-next-pwa [app_name]

# to use Next.js with Typescript
create-next-pwa [app_name] --typescript

# Next.js PWA with tailwind integration using npx
npx create-next-pwa@latest [app_name] --tailwind

# Next.js PWA with tailwind integration if you have globally installed the CLI
create-next-pwa [app_name] --tailwind

# without giving app name in terminal using npx
npx create-next-pwa@latest

# without giving app name in terminal using npx and tailwind integration
npx create-next-pwa@latest --tailwind

# without giving app name in terminal if installed globally
create-next-pwa

# without giving app name in terminal if install globally along with tailwind integration
create-next-pwa --tailwind

help

🎩 Demo

# using npx
npx create-next-pwa [app_name]
with npx
# integrate tailwind in the Next.js PWA
npx create-next-pwa [app_name] --tailwind
integration of tailwind
# if you have installed globally
create-next-pwa [app_name]
usage with app name
# you can also just use the create-next-pwa command
create-next-pwa
usage without app name

👨🏻‍💻 Contributing

Make sure you read the contributing guidelines before opening a PR. If you want something else to integrate with the CLI like I have done with tailwind, open an issue in the repository and I will get back to it.

⚡️ Other Projects

I have curated a detailed list of all the open-source projects I have authored. Do take out a moment and take a look.

🔑 License & Conduct

changelog

Changes Across Different Versions of create-next-pwa

v3.4.1

  • Improved readme

v3.4.0

  • TypeScript Support (#27) with --typescript flag
  • Help Section that can be accessed using --help`
  • Improved documentation

v3.3.1

  • Fixed .git directory deletion

v3.2.0

  • Removed code reducdancies
  • Improved code structure
  • Removed in-folder
  • Added node-async-exec because of its change directory and cross-platform nature
  • Fixed outdating future dependencies bug #21
  • Added custom error message if the project folder already exists

v2.5.0 to v3.1.9

  • Cross platform directory deletion
  • Used copy command for windows to copy files
  • Took care of file creation for windows
  • Fixed npm dependency installation for windows by making exec a promise
  • Fixed file paths for Windows
  • Fixed git directory deletion for macos
  • Introduced check for update to notify the user if there is an update available of the CLI
  • Added err handlers
  • Removed jsonfile and used json-write-file instead

v2.4.0

  • Integration of tailwind for Next.js PWAs
  • Code refactoring
  • One file path handling
  • Fixed flags and input bug
  • Improved UI

v1.3.0

  • Integrated create-next-app
  • Generated PWA
  • Integrated prettier