poptab
v1.0.4
Published
A CLI tool and library to clean up specific browser tabs.
Maintainers
Readme
poptab
A CLI tool and library to clean up specific browser tabs.
Overview
This is a trivial CLI tool to close browser tabs whose URLs contain a given URL string.
I use it in a few projects to clean up stale tabs during development sessions.
Getting started
Dependencies
The poptab CLI tool requires Node 20.19.0+. The exported APIs are ESM-only and share the Node 20.19.0+ requirement. Poptab is implemented in TypeScript and bundles type definitions.
This is a macOS-only tool. It can close tabs in Chromium, Chrome, or Safari.
Installation
Invoke directly:
npx poptabOr, install locally to access the CLI commands in a single project or to import the provided APIs:
npm install poptabOr, install globally for access across your system:
npm install --global poptabUsage
By default, poptab will close tabs in an open Chromium browser containing //localhost:.
Library
import { popTab } from 'poptab'
const closedTabs = await popTab({
browser: 'chrome',
urlContains: '127.0.0.1:',
})
console.log(`Closed ${closedTabs} tab(s)`)CLI
Command: poptab
Close browser tabs containing a given URL string.
Usage:
poptab| Option | Description | Type | Default |
| ------------------------ | ---------------------------------------------- | ---------------------------------- | ---------------- |
| --browser-b | Browser to target for tab cleanup | "chromium" "chrome" "safari" | "chromium" |
| --url-contains-u | String that tab URLs must contain to be closed | string | "//localhost:" |
| --help-h | Show help | boolean | |
| --version-v | Show version number | boolean | |
Maintainers
Contributing
Issues and pull requests are welcome.
License
MIT © Eric Mika
