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

@repl-utils/test

v0.1.2

Published

A template for creating publishable JS packages with TypeScript, testing, and Next.js integration

Downloads

17

Readme

JS Package Template

A comprehensive template for creating publishable JavaScript/TypeScript packages with built-in testing, Next.js integration, and automated publishing workflow.

Global CLI Installation

Install the CLI globally to create new packages anywhere:

# Clone and build this template first
git clone <your-repo-url> js-package-template
cd js-package-template
pnpm install
pnpm build

# Install globally
npm link
# or
pnpm link --global

# Now you can use it anywhere
create-js-package create my-awesome-package
cd my-awesome-package
pnpm install

CLI Commands

  • create-js-package create <name> - Create a new package in a directory
  • create-js-package create <name> --dir <path> - Create in specific directory
  • create-js-package init - Initialize current directory as a package

Features

  • TypeScript Support: Full TypeScript support with separate builds for browser and server environments
  • Automated Publishing: Simple pnpm run pub --name <package-name> command for publishing to npm
  • Testing Setup:
    • Unit tests with Vitest
    • E2E tests with Playwright
    • Dynamic Next.js app creation for testing
  • Next.js Integration: Optimized for use in Next.js applications
  • Dual Environment Support: Separate exports for browser and server code
  • Test Utilities: createNext utility for spinning up Next.js apps dynamically in tests
  • Visualization Dashboard: Built-in app to visualize tests and package information

Quick Start

  1. Install dependencies:
pnpm install
  1. Build the package:
pnpm build
  1. Run tests:
pnpm test        # Run all tests
pnpm test:unit   # Run unit tests only
pnpm test:e2e    # Run e2e tests only
  1. Publish to npm:
pnpm run pub --name my-package-name

Project Structure

├── src/
│   ├── browser/        # Browser-specific code
│   ├── server/         # Server-specific code
│   └── test-utils/     # Testing utilities
├── tests/
│   ├── unit/          # Unit tests
│   └── e2e/           # E2E tests
├── examples/
│   ├── next-app/      # Example Next.js app
│   └── vite-app/      # Example Vite app
└── visualization-app/  # Test visualization dashboard

Using the Package

Browser Code

import { browserFunction, createBrowserLogger } from 'my-package/browser'

const logger = createBrowserLogger()
logger.log('Hello from browser!')

Server Code

import { serverFunction, createServerLogger } from 'my-package/server'

const logger = createServerLogger()
logger.log('Hello from server!')

Test Utilities

import { createNext } from 'my-package/test-utils'

const app = await createNext({
  files: {
    'app/page.tsx': `export default function Page() { return <h1>Test</h1> }`
  }
})
// App is now running at app.url
await app.cleanup() // Clean up when done

Visualization Dashboard

Start the visualization app to see package info and run tests:

cd visualization-app
pnpm install
pnpm dev

Visit http://localhost:4000 to see:

  • Package information
  • Exported functions
  • Test runner with live results

Scripts

  • pnpm dev - Start development mode with watch
  • pnpm build - Build the package
  • pnpm test - Run all tests
  • pnpm typecheck - Run TypeScript type checking
  • pnpm lint - Run ESLint
  • pnpm format - Format code with Prettier
  • pnpm pub --name <name> - Publish package to npm

License

MIT