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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tshifhiwa/playwright-advanced-encryption

v1.0.0

Published

A secure encryption and key rotation system for Playwright automation. It safeguards sensitive credentials and secrets used in automated testing, ensuring robust security and compliance.

Downloads

17

Readme

Playwright Advanced Encryption

Overview

The Playwright Advanced Encryption module is a secure encryption and key rotation system purpose-built for Playwright automation frameworks. It ensures that sensitive credentials and secrets remain protected, auditable, and compliant within CI/CD pipelines.


Key Features

  • AES-GCM encryption with Argon2-based key derivation
  • Automatic key rotation for enhanced long-term security
  • Environment-based secret handling (isolated per environment)
  • Seamless Playwright integration with minimal setup
  • Keeps secrets out of source control and test reports
  • Metadata and audit tracking for key lifecycle visibility

Setup & Getting Started

1. Install Dependencies

Ensure Node.js is installed, then run:

npm install

2. Environment Configuration

All configurations are stored under the envs/ directory and excluded from version control for security.

Steps

  1. Open .env.template
  2. Copy it to .env.<env> (e.g. .env.qa)
  3. Fill in environment-specific credentials

Supported environments: dev, qa, uat, preprod

Example .env file

PORTAL_BASE_URL=https://portal.example.com
PORTAL_USERNAME=portal.user
PORTAL_PASSWORD=portal.password

Encryption System

Sensitive credentials are encrypted using AES-GCM, with encryption keys derived via Argon2 for strong cryptographic safety.

Command Categories (Playwright Tags)

| Category | Tag | Description | | -------------- | ------------------ | ---------------------------------------- | | Key Generation | @generate-key | Creates a new encryption key | | Encryption | @env-encryption | Encrypts environment variables | | Key Rotation | @key-rotation | Rotates expired keys | | Batch Rotation | @batch-rotation | Rotates all environments in one go | | Audit | @key-audit | Logs and verifies key rotation history | | Metadata | @metadata | Displays key metadata (hash, date, etc.) | | Error Handling | @error-handling | Ensures proper exception coverage | | Warning Status | @status-warnings | Displays upcoming expiry warnings |


Running Encryption Commands

To run encryption tasks, use Playwright with the appropriate tag:

npx cross-env SKIP_BROWSER_INIT=true PLAYWRIGHT_GREP=@<tag> ENV=<env> npm run test:encryption

Replace <env> with one of: dev, qa, uat, preprod

Batch Rotation (all environments)

npx cross-env SKIP_BROWSER_INIT=true PLAYWRIGHT_GREP=@batch-rotation npm run test:encryption

First-Time Setup Example (Dev Environment)

  1. Generate the encryption key:

    npx cross-env SKIP_BROWSER_INIT=true PLAYWRIGHT_GREP=@generate-key ENV=dev npm run test:encryption
  2. Encrypt environment credentials:

    npx cross-env SKIP_BROWSER_INIT=true PLAYWRIGHT_GREP=@env-encryption ENV=dev npm run test:encryption

Note:

  • The rotation runs automatically whenever you execute encryption tests.
  • If a key is expired, it will rotate automatically.
  • If a key is expiring within 7 days, a warning is displayed.
  • You can also manually trigger rotation:
npx cross-env SKIP_BROWSER_INIT=true PLAYWRIGHT_GREP=@key-rotation ENV=dev npm run test:encryption

Timeout Configuration

Defined in src/configuration/timeouts/timeout.config.ts

Features

  • Centralized TimeoutManager ensures consistent timeout values.

  • Automatically scales for CI/CD environments via EnvironmentDetector.isCI().

  • Categorized configuration for different test layers:

    | Category | Purpose | | -------- | ---------------------- | | test | Test execution timeout | | expect | Assertion timeout | | api | External service calls | | db | Database operations |

  • Dynamic timeout adjustments based on environment type.


Code Quality & Standards

Code quality is enforced via pre-commit automation:

  • Husky → Git hooks integration
  • Lint-Staged → Lints only staged files
  • ESLint → Strict TypeScript linting
  • Prettier → Code formatting consistency

Rules:

  • Only console.warn and console.error are allowed.
  • Pre-configured VS Code workspace settings ensure consistent local development.

Config files: .prettierrc, .vscode/settings.json, eslint.config.mjs