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

lhi_chrome_profile_utils

v1.0.26

Published

Professional utility for Chrome profile selection and management on macOS, designed for Puppeteer, MCP servers, and browser automation workflows

Readme

LHI Chrome Profile Utils

A professional utility for Chrome profile selection and management on macOS, designed for use with Puppeteer, MCP servers, and browser automation workflows.

npm version License: MIT

Features

  • 🔍 Profile Detection: Automatically detects and lists all Chrome profiles on macOS
  • 🎯 Profile Selection: Interactive UI dialog for selecting Chrome profiles
  • 🚀 Direct Chrome Launch: Launch Chrome directly with selected profile (recommended)
  • 💾 Profile Data Export: Save profile information to JSON for later use
  • 🔧 CLI Interface: Command-line tools for profile management

Installation

npm install lhi_chrome_profile_utils

Usage

Recommended: Direct Chrome Launch

For the best user experience with full profile features (avatar, theme, bookmarks), use direct Chrome launching:

const { spawn } = require('child_process');
const chromeProfileUtils = require('lhi_chrome_profile_utils');

// Select a profile via UI dialog
const { chromeUserDataPath, selectedProfilePath, userDataDir } = chromeProfileUtils.getSelectedProfile();

// Launch Chrome directly
const chromeArgs = [
  `--profile-directory=${selectedProfilePath}`,
  `--user-data-dir=${userDataDir}`,
  '--disable-blink-features=AutomationControlled',
  'https://mail.google.com'
];

const chromeProcess = spawn('/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', chromeArgs, {
  detached: true,
  stdio: 'ignore'
});

chromeProcess.unref();

Alternative: Puppeteer Integration

For automation testing (note: may not show full profile features):

const puppeteer = require('puppeteer');
const chromeProfileUtils = require('lhi_chrome_profile_utils');

// Get Puppeteer launch options with the selected profile
const puppeteerOptions = chromeProfileUtils.getPuppeteerLaunchOptions();
const browser = await puppeteer.launch(puppeteerOptions);

As a Node.js Module

const chromeProfileUtils = require('lhi_chrome_profile_utils');

// List all Chrome profiles
const { chromeUserDataPath, profiles } = chromeProfileUtils.listProfiles();
console.log(`Found ${profiles.length} profiles`);

// Select a profile via UI dialog
const selectedProfilePath = chromeProfileUtils.selectProfile(profiles);

// Save profile data to JSON
chromeProfileUtils.saveProfilesJSON({ chromeUserDataPath, profiles }, './profiles.json');

Command Line Interface

The package can be used directly from the command line:

# List all available Chrome profiles
npx lhi_chrome_profile_utils list

# Select a Chrome profile via dialog
npx lhi_chrome_profile_utils select

# Get Puppeteer launch options for selected profile
npx lhi_chrome_profile_utils puppeteer-options

# Export profile data to JSON file
npx lhi_chrome_profile_utils json [output_path]

Important Notes

First-Time Login

When using direct Chrome launching (recommended approach):

  • If this is your first time using a profile with this script, Chrome may require a one-time login
  • After this initial login, subsequent launches will automatically use your saved profile
  • This is normal Chrome security behavior when launching from a new context

Puppeteer vs Direct Launch

  • Direct Chrome Launch (recommended): Full profile features, normal Chrome behavior
  • Puppeteer Launch: Automation mode, may show warnings, limited profile features

Troubleshooting

If Chrome opens in a semi-incognito mode or doesn't show your profile:

  1. Use the direct Chrome launch approach instead of Puppeteer
  2. Ensure you've logged in at least once using the direct launch method
  3. Check that Chrome is the ARM-native version on Apple Silicon Macs

API Reference

listProfiles()

Lists all Chrome user profiles with detailed information.

Returns: Object with:

  • chromeUserDataPath: Path to Chrome user data directory
  • profiles: Array of profile objects with details (email, name, theme color, etc.)

selectProfile(profiles)

Displays a macOS dialog for profile selection.

Parameters:

  • profiles: Array of profile objects from listProfiles()

Returns: String - The path of the selected profile

getSelectedProfile()

Combines listing and selection in one step.

Returns: Object with:

  • chromeUserDataPath: Path to Chrome user data directory
  • selectedProfilePath: Path of the selected profile
  • userDataDir: Full path to the selected profile directory

getPuppeteerLaunchOptions(headless = false)

Gets Puppeteer launch options for the selected Chrome profile.

Parameters:

  • headless: Boolean indicating whether to run in headless mode (default: false)

Returns: Object - Puppeteer launch options with user data directory

saveProfilesJSON(profileData, outputPath)

Saves profile data to a JSON file.

Parameters:

  • profileData: Profile data object from listProfiles()
  • outputPath: Path where to save the JSON file

Returns: Boolean - Success status

Requirements

  • macOS operating system
  • Google Chrome installed
  • Node.js 14.0.0 or higher

License

MIT © Lifehack Innovations LLC