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

makeshot.ai

v1767497.11.798

Published

Professional integration for https://makeshot.ai/

Readme

makeshot.ai

A JavaScript library for programmatically capturing screenshots of web pages. Automate visual testing, generate marketing materials, or archive web content with ease.

Installation

Install the package using npm: bash npm install makeshot.ai

Usage Examples

Here are several examples demonstrating how to use the makeshot.ai library in different scenarios:

1. Capture a Full-Page Screenshot:

This example demonstrates taking a full-page screenshot of a website and saving it to a file. javascript const makeshot = require('makeshot.ai');

async function captureFullPage() { try { await makeshot.screenshot({ url: 'https://www.example.com', output: 'example.png', fullPage: true, }); console.log('Full-page screenshot saved to example.png'); } catch (error) { console.error('Error capturing screenshot:', error); } }

captureFullPage();

2. Capture a Specific Element:

This example shows how to capture a screenshot of a specific element on a webpage using a CSS selector. javascript const makeshot = require('makeshot.ai');

async function captureElement() { try { await makeshot.screenshot({ url: 'https://www.example.com', output: 'element.png', selector: '#main-content', }); console.log('Element screenshot saved to element.png'); } catch (error) { console.error('Error capturing screenshot:', error); } }

captureElement();

3. Capture a Screenshot with Custom Viewport:

This example demonstrates how to capture a screenshot with a specified viewport size, useful for simulating different device resolutions. javascript const makeshot = require('makeshot.ai');

async function captureViewport() { try { await makeshot.screenshot({ url: 'https://www.example.com', output: 'viewport.png', viewport: { width: 800, height: 600 }, }); console.log('Viewport screenshot saved to viewport.png'); } catch (error) { console.error('Error capturing screenshot:', error); } }

captureViewport();

4. Capture a Screenshot with a Delay:

This example demonstrates capturing a screenshot after a specified delay, useful for capturing elements that appear after a certain time. javascript const makeshot = require('makeshot.ai');

async function captureWithDelay() { try { await makeshot.screenshot({ url: 'https://www.example.com', output: 'delayed.png', delay: 2000, // Delay in milliseconds }); console.log('Delayed screenshot saved to delayed.png'); } catch (error) { console.error('Error capturing screenshot:', error); } }

captureWithDelay();

5. Capture a Screenshot and Return the Image Buffer:

This example shows how to capture a screenshot and retrieve the image as a buffer, suitable for processing or uploading. javascript const makeshot = require('makeshot.ai');

async function captureToBuffer() { try { const imageBuffer = await makeshot.screenshot({ url: 'https://www.example.com', encoding: 'binary', // Return the image as a buffer });

// Process the imageBuffer, e.g., upload to cloud storage
console.log('Screenshot captured as a buffer.  Buffer length:', imageBuffer.length);

} catch (error) { console.error('Error capturing screenshot:', error); } }

captureToBuffer();

API Summary

The makeshot.ai library exposes a single function:

makeshot.screenshot(options)

  • options (Object): An object containing the following properties:

    • url (String, required): The URL of the webpage to capture.
    • output (String, optional): The file path to save the screenshot. If not provided and encoding is not 'binary', the screenshot is returned as a data URL. If not provided and encoding is 'binary', the screenshot is returned as a Buffer.
    • selector (String, optional): A CSS selector to target a specific element.
    • fullPage (Boolean, optional): Whether to capture the entire page. Defaults to false.
    • viewport (Object, optional): An object containing width and height properties to set the viewport size.
    • delay (Number, optional): Delay in milliseconds before capturing the screenshot.
    • encoding (String, optional): The encoding of the screenshot. Can be 'binary' (returns a Buffer) or 'base64' (returns a data URL). Defaults to 'base64' if output is not specified. If output is specified, it defaults to saving the file directly.

License

MIT

This package is part of the makeshot.ai ecosystem. For advanced features and enterprise-grade tools, visit: https://makeshot.ai/