npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@netanelh2/create-playwright-project

v4.3.0

Published

CLI tool to scaffold new Playwright projects with @netanelh2/playwright-framework (updated)

Downloads

183

Readme

@netanelh2/create-playwright-project

🎭 CLI tool to scaffold new Playwright TypeScript projects with the @netanelh2/playwright-framework.

Features

  • Interactive Setup: Choose between minimal or full-featured project templates
  • Modern Configuration: Biome for linting and formatting with biome.json
  • Framework Integration: Automatic @netanelh2/playwright-framework dependency setup
  • ES Modules: Proper module configuration
  • Example Tests: Includes login page examples with fixtures and locators

Quick Start

Create a new Playwright project using npx (recommended):

npx @netanelh2/create-playwright-project my-project-name

Or install globally and use:

npm install -g @netanelh2/create-playwright-project
create-playwright-project my-project-name

Usage

Interactive Mode (Default)

Run without arguments to be prompted for configuration:

npx @netanelh2/create-playwright-project

With Project Name

Specify a project name and get prompted for other options:

npx @netanelh2/create-playwright-project my-awesome-tests

Non-Interactive Mode

Skip all prompts and use defaults:

npx @netanelh2/create-playwright-project my-project --yes

Command Options

  • [project-name] - Name of the project directory to create
  • -y, --yes - Skip prompts and use default settings
  • --no-install - Skip automatic dependency installation
  • --no-git - Skip git repository initialization
  • -f, --force - Force scaffolding into existing directory without prompts

Examples

# Create with all defaults
npx @netanelh2/create-playwright-project my-tests --yes

# Create without installing dependencies
npx @netanelh2/create-playwright-project my-tests --no-install

# Create without git initialization
npx @netanelh2/create-playwright-project my-tests --no-git

# Force scaffolding into existing directory
npx @netanelh2/create-playwright-project existing-folder --force

# Create with custom configuration (interactive)
npx @netanelh2/create-playwright-project my-tests

Existing Directories

The CLI handles existing directories intelligently:

Safe Directories

If the target directory exists but only contains "safe" files (like .git, README.md, LICENSE, etc.), you'll be prompted to confirm scaffolding into it:

npx @netanelh2/create-playwright-project existing-project
# Directory existing-project exists but appears safe to scaffold into. Continue? (y/N)

Non-Safe Directories

If the directory contains other files, the CLI will show an error and suggest using --force:

npx @netanelh2/create-playwright-project existing-project
# ❌ Directory existing-project already exists!
# Contents: package.json, src, node_modules
# Use --force to scaffold into this directory anyway, or choose a different name.

Force Mode

Use --force to scaffold into any existing directory without prompts:

npx @netanelh2/create-playwright-project existing-project --force

⚠️ Warning: Force mode will overwrite existing files with the same names as template files.

What Gets Created

The CLI creates a new Playwright TypeScript project with:

  • Playwright configuration optimized for CI/CD with smart retry logic
  • 3-Layer architecture: Core utilities, Page Objects, Tests
  • Centralized locators with type safety and role-based patterns
  • Custom test fixtures for dependency injection
  • Environment configuration with .env support
  • Modern code quality tools: Biome for linting and formatting
  • Comprehensive npm scripts for testing, linting, formatting, and type checking
  • Sample tests and page objects (optional)
  • ES Modules with proper import/export handling

Project Structure

Project Structure

my-project/
├── src/
│   ├── fixtures/         # Test setup and dependency injection
│   ├── locators/         # Centralized element locators
│   ├── pages/           # Page Object Model classes
│   ├── tests/           # Test specifications
│   └── types/           # TypeScript type definitions
├── biome.json           # Biome linter and formatter configuration
├── playwright.config.ts  # Playwright configuration with smart retries
├── package.json         # Modern scripts and dependencies
├── tsconfig.json        # TypeScript 5.x with project references
└── .env.example         # Environment variables template

After Creation

Once your project is created, navigate to it and start testing:

cd my-project

# Testing
npm test                      # Run all tests
npm run test:headed           # Run tests with browser UI
npm run test:chrome           # Run tests in Chrome only
npm run test:sanity           # Run @sanity tagged tests
npm run test:regression       # Run @regression tagged tests
npm run test:sanity:chrome    # Run @sanity tests in Chrome only
npm run test:regression:chrome # Run @regression tests in Chrome only
npm run test:debug            # Open Playwright Inspector
npm run report                # View test results
npm run codegen               # Launch Playwright code generator

# Code Quality
npm run check                 # Run all quality checks (Biome lint + format + types)
npm run type-check            # TypeScript 5.x compilation check
npm run pre-commit            # Run pre-commit hooks (lint-staged)

# CI/CD
npm run trigger-ci            # Trigger CI workflows for testing

Requirements

  • Node.js 18.0.0 or higher
  • npm or yarn

Related Packages

License

MIT

Support