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

screenshotpro-devices

v1.0.0

Published

Device emulation definitions for ScreenshotPro API - viewport sizes, user agents, and device capabilities

Downloads

14

Readme

screenshotpro-devices

NPM package

Device emulation definitions for ScreenshotPro API - viewport sizes, user agents, and device capabilities compatible with Puppeteer and Playwright.

Installation

npm install screenshotpro-devices

Usage

import devices from 'screenshotpro-devices';

// Get all device names
console.log(devices.names);
// ['iphone_15_pro_max', 'iphone_15_pro_max_landscape', 'iphone_15_pro', ...]

// Get a specific device
const iphone = devices.devices['iphone_15_pro'];
console.log(iphone);
// {
//   id: 'iphone_15_pro',
//   name: 'iPhone 15 Pro',
//   userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_0...',
//   viewport: {
//     width: 393,
//     height: 852,
//     deviceScaleFactor: 3,
//     isMobile: true,
//     hasTouch: true,
//     isLandscape: false
//   }
// }

// Use with Playwright
import { chromium } from 'playwright';

const browser = await chromium.launch();
const context = await browser.newContext({
  ...iphone.viewport,
  userAgent: iphone.userAgent,
});
const page = await context.newPage();
await page.goto('https://example.com');

API

devices

Main export containing all device definitions.

Properties:

  • names: string[] - Array of all device keys (lowercase with underscores)
  • devices: Record<string, Device> - Object mapping device keys to device definitions

Device

Device definition interface (compatible with Puppeteer/Playwright).

interface Device {
    name: string;              // Display name (e.g., "iPhone 15 Pro")
    userAgent: string;         // User agent string
    viewport: Viewport;        // Viewport configuration
}

Viewport

Viewport configuration interface (compatible with Puppeteer/Playwright).

interface Viewport {
    width: number;             // Viewport width in pixels
    height: number;            // Viewport height in pixels
    deviceScaleFactor?: number; // Device pixel ratio (e.g., 2, 3)
    isMobile?: boolean;        // Whether device is mobile
    isLandscape?: boolean;     // Whether device is in landscape orientation
    hasTouch?: boolean;        // Whether device has touch support
}

Supported Devices

The package includes 40 device definitions (20 unique devices × 2 orientations):

iPhone Devices (10 models = 20 definitions)

  • iPhone 15 Pro Max (portrait + landscape)
  • iPhone 15 Pro (portrait + landscape)
  • iPhone 15 (portrait + landscape)
  • iPhone 14 Pro Max (portrait + landscape)
  • iPhone 14 Pro (portrait + landscape)
  • iPhone 14 (portrait + landscape)
  • iPhone 13 Pro Max (portrait + landscape)
  • iPhone 13 (portrait + landscape)
  • iPhone 12 Pro (portrait + landscape)
  • iPhone SE (portrait + landscape)

Android Devices (6 models = 12 definitions)

  • Samsung Galaxy S23 Ultra (portrait + landscape)
  • Google Pixel 7 Pro (portrait + landscape)
  • Google Pixel 7 (portrait + landscape)
  • OnePlus 11 (portrait + landscape)
  • Galaxy S9+ (portrait + landscape)
  • Nexus 5X (portrait + landscape)

Tablet Devices (4 models = 8 definitions)

  • iPad Pro 12.9" (portrait + landscape)
  • iPad Pro 11" (portrait + landscape)
  • iPad Mini (portrait + landscape)
  • Galaxy Tab S4 (portrait + landscape)

Device Key Format

Device names are converted to lowercase keys with underscores:

  • "iPhone 15 Pro""iphone_15_pro"
  • "iPad Pro 12.9""ipad_pro_12.9"
  • "Galaxy S23 Ultra""galaxy_s23_ultra"

Examples

List all iPhone devices

import devices from 'screenshotpro-devices';

const iPhones = devices.names
  .filter(name => name.startsWith('iphone'))
  .map(name => devices.devices[name]);

console.log(iPhones);

Get only portrait devices

import devices from 'screenshotpro-devices';

const portraitDevices = devices.names
  .filter(name => !name.includes('landscape'))
  .map(name => devices.devices[name]);

console.log(portraitDevices);

Use with Puppeteer

import puppeteer from 'puppeteer';
import devices from 'screenshotpro-devices';

const browser = await puppeteer.launch();
const page = await browser.newPage();

const device = devices.devices['iphone_15_pro'];
await page.setUserAgent(device.userAgent);
await page.setViewport(device.viewport);
await page.goto('https://example.com');

TypeScript Support

The package includes full TypeScript definitions. All interfaces are exported:

import devices, { Device, Viewport } from 'screenshotpro-devices';

Contributing

We welcome contributions! If you'd like to add more device definitions or update existing ones, please open a pull request at https://github.com/screenshotpro/devices.

License

Apache 2.0 - See LICENSE file for details.

Related Packages

Support