https://github.com/binary-blazer/shbrw
A headless CLI browser made for screenshots
https://github.com/binary-blazer/shbrw
browser cli frameless headless scb screencapture screenshot
Last synced: 11 months ago
JSON representation
A headless CLI browser made for screenshots
- Host: GitHub
- URL: https://github.com/binary-blazer/shbrw
- Owner: binary-blazer
- License: apache-2.0
- Created: 2025-02-03T19:22:05.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-03-10T17:38:52.000Z (12 months ago)
- Last Synced: 2025-03-29T14:43:43.642Z (12 months ago)
- Topics: browser, cli, frameless, headless, scb, screencapture, screenshot
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/shbrw
- Size: 219 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
Screenshot Browser (shbrw)
Screenshot Browser (shbrw) is a frameless CLI browser designed for taking screenshots of websites. It provides both a CLI and an API for capturing screenshots.
## Usage
Looking for one-time usage? Check the commands below!
```bash
npx shbrw --url=https://binaryblazer.me
# or
pnpm dlx shbrw --url=https://binaryblazer.me
# or
bunx shbrw --url=https://binaryblazer.me
```
> [!TIP]
> Make sure to replace the **``https://binaryblazer.me``** (the value of the the url flag) with your desired URL.
## Installation
To install the package, use npm:
```bash
npm install -g shbrw
# or
yarn global add shbrw
# or
pnpm add -g shbrw
# or
bun install -g shbrw
```
## CLI Usage
To open a headless and frameless browser window, use the following command:
```bash
shbrw --url= [--size=WxH] [--optimized] [--noJS]
```
Then, right-click on the page and select "Take Screenshot" from the context menu.

### CLI Options
- `--url`: The URL of the website to open.
- `--size`: The size of the window in the format `WxH` (default: `1280x720`).
- `--optimized`: Run the website in optimized mode.
- `--noJS`: Disable JavaScript on the website.
## API Usage
You can also use the API to take screenshots programmatically.
### Example
```js
import { takeScreenshot } from 'shbrw';
const url = 'https://example.com';
const options = {
width: 1920,
height: 1080,
x: 0,
y: 0,
noJS: false
};
takeScreenshot(url, options)
.then(buffer => {
// Do something with the screenshot buffer
})
.catch(error => {
console.error('Error taking screenshot:', error);
});
```
### API Options
- `url`: The URL of the website to take a screenshot of.
- `options`: An object containing the following properties:
- `width`: The width of the screenshot (default: `1280`).
- `height`: The height of the screenshot (default: `720`).
- `x`: The x-coordinate of the screenshot (default: `0`).
- `y`: The y-coordinate of the screenshot (default: `0`).
- `noJS`: Disable JavaScript on the website (default: `false`).